diff --git a/.gitignore b/.gitignore index 41f7f34..8f28ede 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .idea/ build/ +manifest.json diff --git a/README.md b/README.md index 734c6f7..57e71ae 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,10 @@ Simply get rid of "🔥🔥 neW BaNger aLErt 🔥🔥" in the comment section ![](images/demo/replace-by-text.png) +#### Click on the Spam icon in the tool bar to customize + +![](images/demo/toolbar.png) + ## Installation To be updated @@ -56,15 +60,25 @@ To be updated git clone https://github.com/dthung1602/the-spamminator ``` 2. Load extension for debugging in Chrome: + - Make a symlink `manifest.json` -> `manifest-v3.json` + ```shell + ln -s manifest.json manifest-v3.json + ``` - Go to [chrome://extensions/](chrome://extensions/) - Click on `Load unpacked` button on the top left - Select the cloned repo - - (!) Note that chrome support for manifest v2 will end in June 2023 3. Load extension for debugging in Firefox: + - Make a symlink `manifest.json` -> `manifest-v2.json` + ```shell + ln -s manifest.json manifest-v2.json + ``` - Go to [about:debugging#/runtime/this-firefox](about:debugging#/runtime/this-firefox) - Click on `Load Temporary Add-on` - Select the manifest.json file - + - Note that Chrome can also load manifest v2, but this will be deprecated in June 2023 +4. Package for distribution: + - Run `build.sh` + - The output zip files are in the `build` directory ## Contributing diff --git a/build.sh b/build.sh index 3155b68..be3d1a2 100644 --- a/build.sh +++ b/build.sh @@ -2,23 +2,33 @@ set -e +echo "--> Start" SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) BUILD_DIR="$SCRIPT_DIR/build" RAW_CONTENT="${BUILD_DIR}/raw" +echo "--> Preparing" if [ -d "$BUILD_DIR" ]; then rm -rf "$BUILD_DIR" fi mkdir -p "$RAW_CONTENT" cd "$SCRIPT_DIR" -cp -r manifest.json vendor scripts popup images "$RAW_CONTENT" +cp -r vendor scripts popup images "$RAW_CONTENT" rm -rf "$RAW_CONTENT/images/demo" cd "$RAW_CONTENT" -zip -r -FS ../the-spamminator.zip * +echo "--> Building FireFox extension" +cp "${SCRIPT_DIR}/manifest-v2.json" manifest.json +zip -r -FS ../the-spamminator-firefox.zip * + +echo "--> Building Chrome extension" +cp "${SCRIPT_DIR}/manifest-v3.json" manifest.json +zip -r -FS ../the-spamminator-chrome.zip * + +echo "--> Cleaning up" cd .. rm -rf "$RAW_CONTENT" -echo "Done!" +echo "--> Done" diff --git a/images/demo/toolbar.png b/images/demo/toolbar.png new file mode 100644 index 0000000..479da7e Binary files /dev/null and b/images/demo/toolbar.png differ diff --git a/manifest.json b/manifest-v2.json similarity index 66% rename from manifest.json rename to manifest-v2.json index c3f332e..67e6691 100644 --- a/manifest.json +++ b/manifest-v2.json @@ -1,13 +1,16 @@ { "manifest_version": 2, "name": "TheSpamminator", - "version": "0.1", - "description": "Remove banger alert spams from comment section of mangakakalot", + "version": "1.0", + "description": "Remove banger alert spams from comment section of mangakakalot & manganato", "icons": { "16": "images/logo/spam-logo-16.png", "32": "images/logo/spam-logo-32.png", "64": "images/logo/spam-logo-64.png" }, + "web_accessible_resources": [ + "images/*" + ], "browser_action": { "default_icon": { "16": "images/logo/spam-logo-16.png", @@ -17,33 +20,25 @@ "default_title": "The Spamminator", "default_popup": "popup/popup.html" }, + "background": { + "scripts": [ + "vendor/browser-polyfill.min.js", + "scripts/service-worker.js" + ] + }, "content_scripts": [ { "matches": [ - "*://mangakakalot.com/chapter/*", - "*://readmanganato.com/manga-*" + "https://www.facebook.com/*" ], "js": [ - "vendor/webextension-polyfill.js", - "scripts/mangasite.js" + "vendor/browser-polyfill.min.js", + "scripts/clean-spams.js" ], "all_frames": true } ], - "background": { - "scripts": [ - "vendor/webextension-polyfill.js", - "scripts/background.js" - ] - }, - "web_accessible_resources": [ - "images/*", - "vendor/webextension-polyfill.js" - ], "permissions": [ - "storage", - "activeTab", - "tabs", - "" + "storage" ] -} \ No newline at end of file +} diff --git a/manifest-v3.json b/manifest-v3.json new file mode 100644 index 0000000..08c8f2d --- /dev/null +++ b/manifest-v3.json @@ -0,0 +1,44 @@ +{ + "manifest_version": 3, + "name": "TheSpamminator", + "version": "1.0", + "description": "Remove banger alert spams from comment section of mangakakalot & manganato", + "icons": { + "16": "images/logo/spam-logo-16.png", + "32": "images/logo/spam-logo-32.png", + "64": "images/logo/spam-logo-64.png" + }, + "web_accessible_resources": [ + { + "resources": ["/images/*"], + "matches": ["https://www.facebook.com/*"] + } + ], + "action": { + "default_icon": { + "16": "images/logo/spam-logo-16.png", + "32": "images/logo/spam-logo-32.png", + "64": "images/logo/spam-logo-64.png" + }, + "default_title": "The Spamminator", + "default_popup": "popup/popup.html" + }, + "background": { + "service_worker": "scripts/service-worker.js" + }, + "content_scripts": [ + { + "matches": [ + "https://www.facebook.com/*" + ], + "js": [ + "vendor/browser-polyfill.min.js", + "scripts/clean-spams.js" + ], + "all_frames": true + } + ], + "permissions": [ + "storage" + ] +} diff --git a/popup/popup.html b/popup/popup.html index 19ab744..5511b4a 100644 --- a/popup/popup.html +++ b/popup/popup.html @@ -28,7 +28,7 @@