SHARE
TWEET

content-policy.js

a guest Jun 13th, 2016 123 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     // Non-matching domain or a resource directly loaded into a tab
  2.     if (!isDenied (uri.host) || Ci.nsIContentPolicy.TYPE_DOCUMENT === typeCode) {
  3.           return Ci.nsIContentPolicy.ACCEPT;
  4.     }    
  5.  
  6.     // ====================================  
  7.     //  console.log('resourceURL_leak_has_been_prevented');
  8.     //          ^---    OR   ---v
  9.  
  10.     var bmessage = "ResourceLeak extension has prevented an attempt by web content to load one or more resource:// URIs";    
  11.     if (typeof window === "undefined"){
  12.            var luwin = Cc["@mozilla.org/appshell/window-mediator;1"]
  13.                .getService(Ci.nsIWindowMediator)
  14.                .getMostRecentWindow("navigator:browser");
  15.     }
  16.     if (typeof gBrowser === "undefined"){
  17.            var gBrowser = luwin.gBrowser;
  18.     }
  19.     let notif = gBrowser.getNotificationBox();
  20.     let buttons = [];
  21.     notif.appendNotification(bmessage, 'uniqID', null,
  22.            notif.PRIORITY_WARNING_MEDIUM,  buttons   );
  23.     // ====================================    
  24.     return Ci.nsIContentPolicy.REJECT_REQUEST;
  25.   }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top