diff --git a/content-scripts/content-script.js b/content-scripts/content-script.js new file mode 100644 index 0000000..aa314a4 --- /dev/null +++ b/content-scripts/content-script.js @@ -0,0 +1,28 @@ +chrome.runtime.onMessage.addListener(handleMessage); + +function handleMessage(request, sender, sendResponse) { + switch(request.name) { + case "highlight-para": + highlightPara(); + case "show-foo": + showFoo(); + case "show-confirm": + showConfirm(); + } + } + +function highlightPara() { + +} + + +function beastNameToURL(beastName) { + switch (beastName) { + case "Frog": + return chrome.extension.getURL("beasts/frog.jpg"); + case "Snake": + return chrome.extension.getURL("beasts/snake.jpg"); + case "Turtle": + return chrome.extension.getURL("beasts/turtle.jpg"); + } +} diff --git a/content-scripts/manifest.json b/content-scripts/manifest.json new file mode 100644 index 0000000..48917da --- /dev/null +++ b/content-scripts/manifest.json @@ -0,0 +1,20 @@ +{ + + "manifest_version": 2, + "name": "Content scripting", + "version": "1.0", + + "applications": { + "gecko": { + "id": "content-scripts@mozilla.org" + } + }, + + "content_scripts": [ + { + "matches": ["https://mdn.github.io/webextensions-examples/"], + "js": ["content-script.js"] + } + ] + +}