Compare commits

..

1 Commits

Author SHA1 Message Date
renovate[bot]
17d41a2957 Update dependency web-ext to v8.2.0 2024-06-24 21:18:22 +00:00
17 changed files with 2803 additions and 1154 deletions

View File

@@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: "Checkout" - name: "Checkout"
uses: actions/checkout@v6 uses: actions/checkout@v4
- name: Install jq - name: Install jq
run: sudo apt-get install jq run: sudo apt-get install jq
@@ -29,11 +29,11 @@ jobs:
with: with:
cmd: build cmd: build
source: . source: .
filename: "rfd-affiliate-stripper-${{steps.vars.outputs.version}}-${{steps.vars.outputs.sha_short}}.xpi" filename: "rfd-redirect-stripper-${{steps.vars.outputs.version}}-${{steps.vars.outputs.sha_short}}.xpi"
ignoreFiles: '[ "package.json","package-lock.json","yarn.lock" ]' ignoreFiles: '[ "package.json","package-lock.json","yarn.lock" ]'
- name: "Upload Artifact" - name: "Upload Artifact"
uses: actions/upload-artifact@v6 uses: actions/upload-artifact@v4
with: with:
name: "rfd-affiliate-stripper-${{steps.vars.outputs.version}}-${{steps.vars.outputs.sha_short}}.xpi" name: "rfd-redirect-stripper-${{steps.vars.outputs.version}}-${{steps.vars.outputs.sha_short}}.xpi"
path: ${{ steps.web-ext-build.outputs.target }} path: ${{ steps.web-ext-build.outputs.target }}

View File

@@ -12,10 +12,10 @@ jobs:
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps: steps:
- uses: actions/checkout@v6 - uses: actions/checkout@v4
- uses: actions/setup-node@v6 - uses: actions/setup-node@v4
with: with:
node-version: 24 node-version: 16
cache: 'npm' cache: 'npm'
cache-dependency-path: package-lock.json cache-dependency-path: package-lock.json
- run: npm ci - run: npm ci

View File

@@ -14,7 +14,7 @@ jobs:
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v6 uses: actions/checkout@v4
- name: Install gomplate - name: Install gomplate
run: | run: |
@@ -25,4 +25,4 @@ jobs:
- name: Run gomplate - name: Run gomplate
run: gomplate < script.js.tmpl > script.js run: gomplate < script.js.tmpl > script.js
- uses: stefanzweifel/git-auto-commit-action@v7 - uses: stefanzweifel/git-auto-commit-action@v5

View File

@@ -1,27 +1,28 @@
# rfd-affiliate-stripper # rfd-redirect-stripper
<a href="https://addons.mozilla.org/en-US/firefox/addon/rfd-redirect-stripper/"><img src="https://user-images.githubusercontent.com/585534/107280546-7b9b2a00-6a26-11eb-8f9f-f95932f4bfec.png" alt="Get rfd-affiliate-stripper for Firefox"></a> rfd-redirect-stripper strips affiliate redirects from deal links posted on https://forums.redflagdeals.com.
<a href="https://chromewebstore.google.com/detail/rfd-affiliate-stripper/nhjomcijhonhoggkckbjjfnjdcefbblo?authuser=0&hl=en"><img src="https://user-images.githubusercontent.com/585534/107280622-91a8ea80-6a26-11eb-8d07-77c548b28665.png" alt="Get rfd-affiliate-stripper for Chrome"></a>
Strips affiliate redirects from deal links posted on RFD.
On every page load, it transforms a link with tracking such as
```
http://www.amazon.ca/gp/redirect.html?ie=UTF8&location=https%3A%2F%2Fwww.amazon.ca%2Fdp%2FB09YXY3DKN%3Fref%3Dcm_sw_r_apan_dp_NX4HJ8HZ3XX2YK1J900A%26ref_%3Dcm_sw_r_apan_dp_NX4HJ8HZ3XX2YK1J900A%26social_share%3Dcm_sw_r_apan_dp_NX4HJ8HZ3XX2YK1J900A%26starsLeft%3D1%26skipTwisterOG%3D1&tag=redflagdealsc-20&linkCode=ur2&camp=15121&creative=330641
```
into
```
https://www.amazon.ca/dp/B09YXY3DKN
```
## Why? ## Why?
This helps navigate around broken links when using certain adblockers. This helps navigate around broken links when using certain adblockers.
## Building the extension ## Tampermonkey Script
This was originally a [Tampermonkey](https://www.tampermonkey.net/) userscript before evolving into a browser extension.
Copy [script.js](./script.js) into Tampermonkey.
## Browser Extensions
### Firefox
The extension is available [here](https://addons.mozilla.org/en-US/firefox/addon/rfd-redirect-stripper/).
Ensure that permissions are granted. If this is not done, the extension will not have permission to execute.
<img width="712" alt="image" src="https://user-images.githubusercontent.com/4519234/231030083-5ff5156a-deec-4e4d-8f35-ebba84a24be8.png">
### Building the extension
To build the extension, run: To build the extension, run:
@@ -40,14 +41,10 @@ An easy way to test regex: [regex101.com](https://regex101.com/).
New config can be tested by pointing the config url of the extension to your own branch. New config can be tested by pointing the config url of the extension to your own branch.
![image](https://user-images.githubusercontent.com/4519234/230703252-a7e09cf6-d0e5-4f54-8973-3b93d4a4a5a2.png)
For example: For example:
```text ```text
https://raw.githubusercontent.com/davegallant/rfd-affiliate-stripper/my-new-branch/redirects.json https://raw.githubusercontent.com/davegallant/rfd-redirect-stripper/my-new-branch/redirects.json
``` ```
## Tampermonkey Script
This was originally a [Tampermonkey](https://www.tampermonkey.net/) userscript before evolving into a browser extension.
To use as a tampermonkey script, copy [script.js](./script.js) into Tampermonkey.

View File

@@ -2,7 +2,7 @@
<html> <html>
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<title>rfd-affiliate-stripper</title> <title>rfd-redirect-stripper</title>
<link rel="stylesheet" href="../css/popup.css" /> <link rel="stylesheet" href="../css/popup.css" />
</head> </head>
<body> <body>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

BIN
icon.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -5,7 +5,7 @@ const saveButton = document.getElementById("save-button");
const resetButton = document.getElementById("reset-button"); const resetButton = document.getElementById("reset-button");
const defaultConfig = const defaultConfig =
"https://raw.githubusercontent.com/davegallant/rfd-affiliate-stripper/main/redirects.json"; "https://raw.githubusercontent.com/davegallant/rfd-redirect-stripper/main/redirects.json";
chrome.storage.local.get("config").then((result) => { chrome.storage.local.get("config").then((result) => {
const value = result.config; const value = result.config;

View File

@@ -20,6 +20,6 @@ export function updateRedirects() {
export function setDefaultConfig() { export function setDefaultConfig() {
chrome.storage.local.set({ chrome.storage.local.set({
config: config:
"https://raw.githubusercontent.com/davegallant/rfd-affiliate-stripper/main/redirects.json", "https://raw.githubusercontent.com/davegallant/rfd-redirect-stripper/main/redirects.json",
}); });
} }

View File

@@ -1,16 +1,12 @@
{ {
"manifest_version": 3, "manifest_version": 3,
"name": "rfd-affiliate-stripper", "name": "rfd-redirect-stripper",
"description": "Strip tracking redirects on rfd", "description": "Strip tracking redirects on rfd",
"version": "0.5.3", "version": "0.4",
"content_scripts": [ "content_scripts": [
{ {
"matches": [ "matches": ["*://forums.redflagdeals.com/*"],
"*://forums.redflagdeals.com/*" "js": ["js/content.js"],
],
"js": [
"js/content.js"
],
"run_at": "document_end" "run_at": "document_end"
} }
], ],
@@ -19,16 +15,12 @@
"default_popup": "html/popup.html" "default_popup": "html/popup.html"
}, },
"background": { "background": {
"scripts": [ "scripts": ["js/background.js"],
"js/background.js"
],
"service_worker": "js/background.js", "service_worker": "js/background.js",
"type": "module" "type": "module"
}, },
"permissions": [ "permissions": ["scripting", "storage", "alarms"],
"storage", "host_permissions": ["*://forums.redflagdeals.com/*"],
"alarms"
],
"browser_specific_settings": { "browser_specific_settings": {
"gecko": { "gecko": {
"id": "davegallant@gmail.com", "id": "davegallant@gmail.com",

3837
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{ {
"devDependencies": { "devDependencies": {
"web-ext": "^9.0.0" "web-ext": "^8.0.0"
}, },
"scripts": { "scripts": {
"start:firefox": "web-ext run --source-dir .", "start:firefox": "web-ext run --source-dir .",

View File

@@ -5,7 +5,7 @@
}, },
{ {
"name": "Best Buy", "name": "Best Buy",
"pattern": "bestbuyca.(.*).net(.*)\\?u=(?<baseUrl>.*)" "pattern": "bestbuyca.(.*).net(.*)\\?u=(?<baseUrl>.*)\\?.*"
}, },
{ {
"name": "HP", "name": "HP",

View File

@@ -1,8 +1,5 @@
{ {
"$schema": "https://docs.renovatebot.com/renovate-schema.json", "$schema": "https://docs.renovatebot.com/renovate-schema.json",
"schedule": [
"every weekend"
],
"extends": [ "extends": [
"config:recommended" "config:recommended"
] ]

View File

@@ -1,13 +1,13 @@
// ==UserScript== // ==UserScript==
// @name RedFlagDeals Affiliate Stripper // @name RedFlagDeals Redirect Stripper
// @author Dave Gallant // @author Dave Gallant
// @description Strip redirect links on forums.redflagdeals.com // @description Strip redirect links on forums.redflagdeals.com
// @downloadURL https://raw.githubusercontent.com/davegallant/rfd-affiliate-stripper/main/script.js // @downloadURL https://raw.githubusercontent.com/davegallant/rfd-redirect-stripper/main/script.js
// @grant none // @grant none
// @match *://forums.redflagdeals.com/* // @match *://forums.redflagdeals.com/*
// @namespace http://tampermonkey.net/ // @namespace http://tampermonkey.net/
// @updateURL https://raw.githubusercontent.com/davegallant/rfd-affiliate-stripper/main/script.js // @updateURL https://raw.githubusercontent.com/davegallant/rfd-redirect-stripper/main/script.js
// @version 2025-12-13 // @version 0.0.1
// ==/UserScript== // ==/UserScript==
(function() { (function() {
@@ -22,7 +22,7 @@
}, },
{ {
"name": "Best Buy", "name": "Best Buy",
"pattern": "bestbuyca.(.*).net(.*)\\?u=(?<baseUrl>.*)" "pattern": "bestbuyca.(.*).net(.*)\\?u=(?<baseUrl>.*)\\?.*"
}, },
{ {
"name": "HP", "name": "HP",

View File

@@ -1,13 +1,13 @@
// ==UserScript== // ==UserScript==
// @name RedFlagDeals Affiliate Stripper // @name RedFlagDeals Redirect Stripper
// @author Dave Gallant // @author Dave Gallant
// @description Strip redirect links on forums.redflagdeals.com // @description Strip redirect links on forums.redflagdeals.com
// @downloadURL https://raw.githubusercontent.com/davegallant/rfd-affiliate-stripper/main/script.js // @downloadURL https://raw.githubusercontent.com/davegallant/rfd-redirect-stripper/main/script.js
// @grant none // @grant none
// @match *://forums.redflagdeals.com/* // @match *://forums.redflagdeals.com/*
// @namespace http://tampermonkey.net/ // @namespace http://tampermonkey.net/
// @updateURL https://raw.githubusercontent.com/davegallant/rfd-affiliate-stripper/main/script.js // @updateURL https://raw.githubusercontent.com/davegallant/rfd-redirect-stripper/main/script.js
// @version {{ (time.Now).Format "2006-01-02" }} // @version 0.0.1
// ==/UserScript== // ==/UserScript==
(function() { (function() {