Skip to content

Instantly share code, notes, and snippets.

View lduros's full-sized avatar

Loic Duros lduros

View GitHub Profile
@lduros
lduros / content-policy.js
Created January 22, 2013 19:46
ochameau's nsIContentPolicy in addon-sdk module
const { Cc, Ci } = require("chrome");
const xpcom = require("xpcom");
const { Class } = require("api-utils/heritage");
exports.preventCrossRequest = Class({
extends: xpcom.Unknown,
interfaces: ["nsIContentPolicy"],
shouldLoad: function (contType, contLoc, reqOrig, ctx, typeGuess, extra) {