Block internet access for a specific Chrome extension? - google-chrome-extension

I want to use a Chrome extension called Focusalarm.
It asks for the permission "Read your browsing history", which the author tells me it needs to find out which tabs are open.
Can I block it from sending this data across the internet?

Related

Chrome extension - How to pass a variable to new tab?

My background page saves data about the current active tab to chrome.storage.local. For arguments sake lets say it's the page title. Multiple page titles will be in there if the user has multiple tabs open.
When the browser action button is clicked I want to open a new tab with my internal extension page showthedata.html (not an external URL) which will show the data saved for the active tab.
Ideally I'd want to open showthedata.html?tabID=123 which would then pull the corresponding data
I must be missing something basic, but how can showthedata.html show the data relating to the active tab?
If you use your extension's URI as the URL of your new tab, it will allow you to use the API's messaging and storage systems from your new tab.
Create a New Tab
chrome.tabs.create({url: "chrome-extension://<your_extension_id>/path/to/file.html"})
Once you get that set up, you can pass variables to or request variables from your new tab via the Chrome API messaging system or storage system (provided you've built the proper functionality into your extension's various parts).
Note: The chrome.tabs namespace is not accessible from within a Chrome tab. It must be called from either your background script(s) or popup.

How to prevent Chrome from automatically blocking audio capture

I'm developing an extension that requires audio access. Under normal circumstances, the user will choose either "Block" or "Allow", and that is fine. Both actions will put the extension in the appropriate place in settings/content/microphone. But while testing, I found if the user were to simply close out the Block/Allow popup by clicking on the "x" in the corner:
then I start to get PermissionDeniedErrors from navigator.mediaDevices.getUserMedia (which makes sense). But there are two big problems to this:
Chrome stops prompting the user if they want to block/allow - it just silently blocks it.
The blocked extension DOES NOT show up in settings/content/microphone. So there is no way for the user to unblock it.
Then some time later (hours? days?), the prompt will come back.
I was digging in the Preferences file to see if maybe something about the extension is in there that wasn't getting surfaced to the UI, and I found this:
From this, I am guessing that Chrome is detecting the "dismissals", and just automatically begins blocking the setting for a period of time ("embargo days").
Is there any kind of action: either programmatic or user-based that can be taken to help direct users to unblock the extension?

Can Chrome Extension’s new options_ui trigger a page action?

I’ve been placing a page action on the options page of my Chrome extension. options.js calls chrome.runtime.connect({"name":"someName"}), and background.js has
chrome.runtime.onConnect.addListener(function(port) {
chrome.pageAction.show(port.sender.tab.id);
});
Unfortunately, in the new options_ui with the recommended default (and someday mandatory) "open_in_tab":false, the Sender's tab won't be set. Is there a way to get the tab id in order to show the page action?
I could use tabs.query to get the chrome://extensions/ tab, but that requires the tabs permission, which I currently don’t need. Active tab seems like it would work, but it doesn’t provide the tab id and isn’t enabled by opening an option dialog (source).
(Why do I want the page action on my options page? The extension works with a website that is only available ~7-10 weeks per year. I’d like my users to be able to interact with the extension the rest of the time, so that they can get used to the process. But I don’t want to adjust the displayed extension permissions just to do so. I can accomplish this by having the options page pretend to be the website in question.)

How to open a new tab in a chrome extension and show data

I have a chrome extension which allows the user to perform actions and build up data. How can I get my chrome extension to open a new tab to allow my user to interact with the data they've accumulated? I could build a separate web app service where I pass the users data to. I currently persist the users data in local storage but I want a way for them to view/edit that data.
Not sure what exactly to google to get a chrome extensions to launch a new page under it's url...
Edit:
Ideally I'd like for my user to press a button from the popup.html popup to open up the new tab, if possible.
I got it to work, basically from the popup.html page I can make this javascript call,
chrome.tabs.create({url: chrome.extension.getURL('dashboard.html')})
where 'dashboard.html' is file belonging to my chrome extension.

Make a Chrome Extension Permissions to Read Only on website

I want to make a Chrome Extension that can only read the webpages and that cannot modify them. I don`t want to see the following message when I click on the extension permissions button : "Read and change all your data one the websites you visit".
I tried the "pageCapture" permission and I still get a message that my extension can read and write all the data on the websites.

Resources