Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// Handle FEAT test requests from a companion extension
var communicate = require("communicate");
chrome.extension.onMessageExternal.addListener(
function (req, sender, sendResponse) {
'use strict';
if (req.type !== "Automation") {
return;
}
// our white-listed FEAT extension
if (sender.id !== "bngnhmnppadfcmpggglniifohlkmddfc") {
return;
}
chrome.tabs.sendMessage(
communicate.activeTab(),
{
panel_op : "test",
test_extension : 'to_html',
outputPath : req.path
}
);
}
);
function ExternalMessaging() {
function a(a) {
d = a
}
function b() {
if (!SAFARI) {
var a = function (a, b, e) {
return b && -1 !== c.indexOf(b.id) ? (a.name && d[a.name] && d[a.name](a, b, e), e ? !0 : void 0) : void log.warn("Got ExternalMessaging request from unexpected sender " + b.id)
};
chrome.runtime.onMessageExternal.addListener(a)
}
}
var c = ["aclkapcoggpdiggeimkkckamndpdcfeb", "ncnnnfnlpehkpkgfcggbkdogjgmihimk"], d = {};
this.setMessageHandlers = a, Object.preventExtensions(this), b()
}
}, O = function (a, b, c) {
if ("false" === p.allowCrossExtensionHistory || "false" === p.storeHistory || !a || !a.getHistory)return !1;
chrome.storage.local.get("word-history", function (a) {
c(a["word-history"])
});
return !0
},
...
}, Q = function () {
var a = window.localStorage.options, b = {};
a && (b = JSON.parse(a));
p = N(b);
window.localStorage.options = JSON.stringify(p);
chrome.storage.local.get("word-history", function (a) {
a["word-history"] || chrome.storage.local.set({"word-history": {}})
});
chrome.runtime.onMessage.addListener(A);
chrome.runtime.onMessage.addListener(B);
chrome.runtime.onMessage.addListener(C);
chrome.runtime.onMessage.addListener(G);
chrome.runtime.onMessageExternal.addListener(O)
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.