3 ms·
Is it possible to write an extension for personal use and have it inject JS and extract information from my own browsing activity without much red tape? I have
by visarga 5y ago
Is it possible to write an extension for personal use and have it inject JS and extract information from my own browsing activity without much red tape?
I have a script that would read out the page (TTS) and save the passages it reads to a log, for now it is a bookmarklet.
- dotproto 5y agoSure. If you're the only one using it, you can just run the extension locally as an unpacked extension. Check out the step-by-step getting started guide: https://developer.chrome.com/docs/extensions/mv3/getstarted/ https://developer.chrome.com/docs/extensions/mv3/getstarted/ For your case, you'll probably want to save the bookmarklet as a JS file, let's say content.js, and inject in when you click the extension's icon. Here's the basics to get you started. manifest.json { "name": "Demo", "version": "1.0", "manifest_version": 3, "permissions": [ "scripting", "activeTab" ], "background": { "service_worker": "background.js" }, "action": {} } background.js chrome.action.onClicked.addListener((tab) => { chrome.scripting.executeScript({ target: {tabId: tab.id}, files: ['content.js'], }); }); content.js alert('It worked!');