简体   繁体   中英

Programatically close browser or disable all chrome extensions instead

I need a solution to quit/close browser at some point in application logic. window.close(); doesn't help me out here as there are cases when several tabs are open, thus I need to close whole browser. I'm not sure if it is entirely possible, as there are indeed security/partical issues here, hence any other solutions or ideas will be appreciated.

This is mainly for stopping certain chrome extensions, maybe there is a way to disable these programatically instead?

The chrome.management API provides ways to manage the list of extensions/apps that are installed and running.

In particular, you have the chrome.management.setEnabled function, which can programmatically enable or disable a chrome extension.

So, you can write your own extension using this API and specifying the "management" permission in the manifest.

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