Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Toggling "Allow Incognito" on settings page turns the flag orange #31

Open
ericlaw1979 opened this issue Aug 1, 2019 · 5 comments
Open
Labels
bug Something isn't working

Comments

@ericlaw1979
Copy link
Contributor

Toggling "Allow Incognito" on the settings page turns the flag orange and enables it such that you end up with this funny UI whereby it offers to submit a report about a chrome: URL:
image

@ericlaw1979
Copy link
Contributor Author

This also happens when toggling the "Allow access to file urls"

The problem goes away if you use Chrome's DevTools to inspect the background page. So the problem may be correlated with the Background page being marked "Inactive"?

@ericlaw1979
Copy link
Contributor Author

ericlaw1979 commented Aug 1, 2019

It may not be relevant for this issue, but it seems like this:

chrome.tabs.query({}, (tabs) => {
      tabs.forEach((tab) => {
        setBrowserActionAndIcon(tab);
      });
    });

could be safely changed to

chrome.tabs.query({"active":true}, (tabs) => {
      tabs.forEach((tab) => {
        setBrowserActionAndIcon(tab);
      });
    });

This would speed up the initial load cost?

@ericlaw1979
Copy link
Contributor Author

One other oddity; if I inspect the background page while toggling these checkboxes, the |Sources| tab seems to show the background page's script loading multiple times. I don't see this with one of my own extensions that uses a background page/js.

image

@ericlaw1979
Copy link
Contributor Author

Documentation for chrome.tabs.onActivated notes that it can fire before tab.url is available, so the setBrowserActionAndIcon call should probably check whether tab.url is assigned before attempting to call startsWith on it.

@ericlaw1979
Copy link
Contributor Author

This also reproduces on Mac OSX in Chrome Canary with the official extension.

Interestingly, when I build the extension locally and load it "unpacked", the problem does not reproduce.

@livvielin livvielin added the bug Something isn't working label Aug 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants