Skip to content

Instantly share code, notes, and snippets.

@ailispaw
Last active January 6, 2020 13:11
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ailispaw/2f15aeabf922afada020 to your computer and use it in GitHub Desktop.
Save ailispaw/2f15aeabf922afada020 to your computer and use it in GitHub Desktop.
Fix missing ctx.host for Chrome Dev 43
// ==Taberareloo==
// {
// "name" : "Fix missing ctx.host"
// , "description" : "Fix missing ctx.host"
// , "include" : ["content"]
// , "match" : ["*://*/*"]
// , "version" : "0.1.1"
// , "downloadURL" : "https://gist.githubusercontent.com/ailispaw/2f15aeabf922afada020/raw/patch.fix.missing.ctx.host.tbrl.js"
// }
// ==/Taberareloo==
(function() {
addAround(TBRL, 'createContext', function (proceed, args, target, methodName) {
var ctx = proceed(args);
if (!ctx.host) {
ctx = update(ctx, url.parse(location.href));
}
return ctx;
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment