简体   繁体   中英

Is there a way to disable chrome_url_override via a Chrome Extension?

Here's the background on my question: I have a chrome extension that overrides the user's new tab with the extension. It is using the chrome_url_overrides permission to override the newtab with my extension.

I need a way to disable this feature since some of our users want to only show our extension when they choose to.

I looked through all the Google Chrome Extension apis and could not find a programmatic way of doing it.

You could use a local setting to detect if the user wants to see the new tab page or not. If they don't want your new experience, you could redirect the newtab to the internal newtab via:

chrome.tabs.update({
  url: 'chrome-internal://newtab/'
});

See: https://stackoverflow.com/a/15016689/76734

@Dalze you can easily fix the flicker by adding a css to the body: set display:none and then if you are loading your newtab change it to show with js - this way you won't have the flicker. (sorry for adding an answer, I was unable to comment above :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM