commit 66a177b26d8b9fbf19e5b78e506b831833d78ce8 Author: OverPoweredDev Date: Sun Jun 13 14:05:30 2021 +0530 started with word-hover diff --git a/src/content/content.js b/src/content/content.js new file mode 100644 index 0000000..bf79c56 --- /dev/null +++ b/src/content/content.js @@ -0,0 +1,3 @@ +console.log(document); + +addHoverTag(); \ No newline at end of file diff --git a/src/content/hover.js b/src/content/hover.js new file mode 100644 index 0000000..a26d4e8 --- /dev/null +++ b/src/content/hover.js @@ -0,0 +1,16 @@ +function addHoverTag() { + $("p").each(function () { + console.log("hi") + $('p').each(function() { + let $this = $(this); + $this.html($this.text().replace(/\b(\w+)\b/g, "$1")); + }); + + }); + + // bind to each hover + $('hover').hover( + function() { $('#word').text($(this).css('background-color','#ffff66').text()); }, + function() { $('#word').text(''); $(this).css('background-color',''); } + ); +} \ No newline at end of file diff --git a/manifest.json b/src/manifest.json similarity index 79% rename from manifest.json rename to src/manifest.json index 26cc0fc..288c030 100644 --- a/manifest.json +++ b/src/manifest.json @@ -29,6 +29,19 @@ ], "persistent": false }, + "content_scripts": [ + { + "matches": [ + "" + ], + "all_frames": true, + "js": [ + "background/jquery.min.js", + "content/hover.js", + "content/content.js" + ] + } + ], "permissions": [ "tabs", "contextMenus"