Compare commits

..

3 Commits

Author SHA1 Message Date
Dave Gallant
65d027740d Add chrome web store link 2024-07-23 07:37:20 -04:00
Dave Gallant
824f3d1367 Remove host permissions 2024-07-23 07:33:21 -04:00
Dave Gallant
f8339f4305 Remove scripting permission 2024-07-20 22:39:42 -04:00
16 changed files with 2796 additions and 1132 deletions

View File

@@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v6
uses: actions/checkout@v4
- name: Install jq
run: sudo apt-get install jq
@@ -29,11 +29,11 @@ jobs:
with:
cmd: build
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" ]'
- name: "Upload Artifact"
uses: actions/upload-artifact@v6
uses: actions/upload-artifact@v4
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 }}

View File

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

View File

@@ -14,7 +14,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v6
uses: actions/checkout@v4
- name: Install gomplate
run: |
@@ -25,4 +25,4 @@ jobs:
- name: Run gomplate
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,26 @@
# 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>
<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
```
rfd-redirect-stripper strips affiliate redirects from deal links posted on <https://forums.redflagdeals.com>.
## Why?
This helps navigate around broken links when using certain adblockers.
## Building the extension
## Browser Extensions
### Chrome
The extension is available on [the chrome web store](https://chromewebstore.google.com/detail/rfd-redirect-stripper/npnhoaofocjfjcjlglaihlhkbgaokmpa?authuser=0&hl=en).
### 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:
@@ -40,10 +39,12 @@ 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.
![image](https://user-images.githubusercontent.com/4519234/230703252-a7e09cf6-d0e5-4f54-8973-3b93d4a4a5a2.png)
For example:
```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

View File

@@ -2,7 +2,7 @@
<html>
<head>
<meta charset="UTF-8" />
<title>rfd-affiliate-stripper</title>
<title>rfd-redirect-stripper</title>
<link rel="stylesheet" href="../css/popup.css" />
</head>
<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 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) => {
const value = result.config;

View File

@@ -20,6 +20,6 @@ export function updateRedirects() {
export function setDefaultConfig() {
chrome.storage.local.set({
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,8 +1,8 @@
{
"manifest_version": 3,
"name": "rfd-affiliate-stripper",
"name": "rfd-redirect-stripper",
"description": "Strip tracking redirects on rfd",
"version": "0.5.3",
"version": "0.5.1",
"content_scripts": [
{
"matches": [

3837
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

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

View File

@@ -1,13 +1,13 @@
// ==UserScript==
// @name RedFlagDeals Affiliate Stripper
// @name RedFlagDeals Redirect Stripper
// @author Dave Gallant
// @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
// @match *://forums.redflagdeals.com/*
// @namespace http://tampermonkey.net/
// @updateURL https://raw.githubusercontent.com/davegallant/rfd-affiliate-stripper/main/script.js
// @version {{ (time.Now).Format "2006-01-02" }}
// @updateURL https://raw.githubusercontent.com/davegallant/rfd-redirect-stripper/main/script.js
// @version 0.0.1
// ==/UserScript==
(function() {