From e65dba16b9b2191bd40e3d1de160187ce12a917c Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Thu, 20 Aug 2015 11:17:37 +0100 Subject: [PATCH] Moved logic to use new file structure --- firefox/index.js | 13 +++++++------ src/site-decoder.js | 4 ---- src/site-decoder.json | 3 +++ 3 files changed, 10 insertions(+), 10 deletions(-) delete mode 100644 src/site-decoder.js create mode 100644 src/site-decoder.json diff --git a/firefox/index.js b/firefox/index.js index 2a8eead..8b60a4a 100644 --- a/firefox/index.js +++ b/firefox/index.js @@ -1,9 +1,10 @@ var self = require('sdk/self'); var pageMod = require("sdk/page-mod"); -var sites = require("data/site-decoder") +var sites = require("data/site-decoder.json") - -pageMod.PageMod({ - include: "*.facebook.com", - contentScriptFile: ["./jquery.js", "./script.js"] -}); \ No newline at end of file +for (var i = 0; i < sites.length; i++) { + pageMod.PageMod({ + include: sites[i][0], + contentScriptFile: ["lib/jquery.js", "./image_lookup.js", "injections/" + sites[i][1]] + }); +} \ No newline at end of file diff --git a/src/site-decoder.js b/src/site-decoder.js deleted file mode 100644 index 8fbc855..0000000 --- a/src/site-decoder.js +++ /dev/null @@ -1,4 +0,0 @@ -var site_decoder = { // Site Identifier : Injection JS - "*.facebook.com":"facebook.js" -} -module.exports = site_decoder; \ No newline at end of file diff --git a/src/site-decoder.json b/src/site-decoder.json new file mode 100644 index 0000000..b58eda9 --- /dev/null +++ b/src/site-decoder.json @@ -0,0 +1,3 @@ +{ // Site Identifier : Injection JS + "*.facebook.com":"facebook.js", +} \ No newline at end of file