Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // A tool for allowing/blocking sites to use flash in Chrome.
- // Usage:
- // 1. Add your sites into the variable `sites` and copy the code to clipboard.
- // 2. Switch to chrome://settings/content/flash in your browser.
- // 3. Press F12 and navigate to `console` tab. Paste the code and hit Enter.
- //////////////////////////////////////////
- // add
- //////////////////////////////////////////
- p = settings.SiteSettingsPrefsBrowserProxyImpl.getInstance();
- var sites = [
- "www.google.com",
- "www.youtube.com",
- ];
- for (var i = 0; i < sites.length; i++) {
- // change ALLOW to BLOCK to block sites
- p.setCategoryPermissionForPattern(
- sites[i],
- sites[i],
- settings.ContentSettingsTypes.PLUGINS,
- settings.ContentSetting.ALLOW,
- false
- );
- }
- //////////////////////////////////////////
- // remove
- //////////////////////////////////////////
- p = settings.SiteSettingsPrefsBrowserProxyImpl.getInstance();
- p.getExceptionList(settings.ContentSettingsTypes.PLUGINS).then(function (sites) {
- for (var i = 0; i < sites.length; i++) {
- p.resetCategoryPermissionForPattern(
- sites[i].origin,
- sites[i].embeddingOrigin,
- settings.ContentSettingsTypes.PLUGINS,
- false
- );
- }
- });
Add Comment
Please, Sign In to add comment