Guest User

Untitled

a guest
May 26th, 2018
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. // A tool for allowing/blocking sites to use flash in Chrome.
  2. // Usage:
  3. // 1. Add your sites into the variable `sites` and copy the code to clipboard.
  4. // 2. Switch to chrome://settings/content/flash in your browser.
  5. // 3. Press F12 and navigate to `console` tab. Paste the code and hit Enter.
  6.  
  7. //////////////////////////////////////////
  8. // add
  9. //////////////////////////////////////////
  10. p = settings.SiteSettingsPrefsBrowserProxyImpl.getInstance();
  11. var sites = [
  12. "www.google.com",
  13. "www.youtube.com",
  14. ];
  15.  
  16. for (var i = 0; i < sites.length; i++) {
  17. // change ALLOW to BLOCK to block sites
  18. p.setCategoryPermissionForPattern(
  19. sites[i],
  20. sites[i],
  21. settings.ContentSettingsTypes.PLUGINS,
  22. settings.ContentSetting.ALLOW,
  23. false
  24. );
  25. }
  26.  
  27. //////////////////////////////////////////
  28. // remove
  29. //////////////////////////////////////////
  30. p = settings.SiteSettingsPrefsBrowserProxyImpl.getInstance();
  31. p.getExceptionList(settings.ContentSettingsTypes.PLUGINS).then(function (sites) {
  32. for (var i = 0; i < sites.length; i++) {
  33. p.resetCategoryPermissionForPattern(
  34. sites[i].origin,
  35. sites[i].embeddingOrigin,
  36. settings.ContentSettingsTypes.PLUGINS,
  37. false
  38. );
  39. }
  40. });
Add Comment
Please, Sign In to add comment