Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Non-matching domain or a resource directly loaded into a tab
- if (!isDenied (uri.host) || Ci.nsIContentPolicy.TYPE_DOCUMENT === typeCode) {
- return Ci.nsIContentPolicy.ACCEPT;
- }
- // ====================================
- // console.log('resourceURL_leak_has_been_prevented');
- // ^--- OR ---v
- var bmessage = "ResourceLeak extension has prevented an attempt by web content to load one or more resource:// URIs";
- if (typeof window === "undefined"){
- var luwin = Cc["@mozilla.org/appshell/window-mediator;1"]
- .getService(Ci.nsIWindowMediator)
- .getMostRecentWindow("navigator:browser");
- }
- if (typeof gBrowser === "undefined"){
- var gBrowser = luwin.gBrowser;
- }
- let notif = gBrowser.getNotificationBox();
- let buttons = [];
- notif.appendNotification(bmessage, 'uniqID', null,
- notif.PRIORITY_WARNING_MEDIUM, buttons );
- // ====================================
- return Ci.nsIContentPolicy.REJECT_REQUEST;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement