Last active
July 4, 2016 21:40
-
-
Save bobsilverberg/3df985bec01f3f2872f230be8621b0ff to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 | |
} | |
); | |
} | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
}, 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