Skip to content

Godhet/bonusradar

Repository files navigation

Bonusradar

A browser extension (MV3, for Firefox and Chrome) that shows a small widget when the site you're on is a SAS EuroBonus shopping partner, with the points rate and a one-click link to shop via the portal so you actually earn them. Covers all three EuroBonus markets on LoyaltyKey's catalog: Sweden, Norway and Denmark. There's also an iOS Safari userscript build.

How it works

There is no bundled shop list to go stale. On install (and once a day) the extension fetches the SAS partner catalog for all three markets straight from LoyaltyKey's browser-extension API:

https://onlineshopping.loyaltykey.com/api/browser-extension/sas/<locale>/shops

(sv-SE, nb-NO, da-DK) — each returns a { "domain": "shopId" } map. The three maps are merged locally into one index; a domain that's a partner in more than one market keeps a separate entry per market, since the shop id, points rate and tracked clickthrough link are market-specific.

The current tab's hostname is matched locally against that index (so your browsing isn't sent anywhere). Only when you're actually on a partner site does it fetch that one shop's detail (/shops/<shopId>) to show the points and the tracked clickthrough URL.

Home country: auto-detected from your browser's language (sv → Sweden, nb/nn/no → Norway, da → Denmark, anything else defaults to Sweden). Click the toolbar icon to override it — useful if a shop is a partner in more than one market and you want the widget to use the tracked link for the market you're actually a EuroBonus member in.

The widget has two states. Blue (with a "shop via EuroBonus portal" link) means you're on a partner site but not in a tracked session. Green ("EuroBonus tracking active!") means you arrived via the portal and points will actually track — detected from the affiliate params SAS leaves on the landing URL (utm_campaign naming the flysas portal, or a network click-id like tduid/awc/at_gd alongside an affiliate utm_medium), with document.referrer as a supplementary hint.

Load it in Firefox

  1. Go to about:debugging#/runtime/this-firefox
  2. Load Temporary Add-on… → pick this folder's manifest.json (or run python3 build.py and pick the resulting .xpi)
  3. Open the extension's console (Inspect on this Firefox page) — you should see a line like loaded shops — SE: 454, NO: 236, DK: 272; adlibris.com present: true
  4. Visit https://www.adlibris.com/sv — the widget should appear as a small badge top-right.

Temporary add-ons vanish on restart. To make it permanent, sign it: submit the zip to addons.mozilla.org as an unlisted add-on and self-install the signed .xpi, or set xpinstall.signatures.required to false on Firefox Developer/Nightly/ESR.

Load it in Chrome

No terminal needed — just download and click:

  1. Go to the latest release and download bonusradar-chrome-<version>.zip.
  2. Unzip it: on Windows right-click the file → Extract All; on Mac double-click it. You'll get a folder called bonusradar-chrome-<version>.
  3. Open Chrome, type chrome://extensions in the address bar, and press Enter.
  4. Turn on Developer mode (switch in the top-right corner).
  5. Click Load unpacked and choose the folder from step 2.
  6. Done — visit https://www.adlibris.com/sv and a small badge appears top-right when you're on a partner shop.

Keep the unzipped folder where it is (don't delete it) — Chrome loads the extension from that folder. Chrome may show a "Disable developer mode extensions" pop-up now and then; just click Keep. The extension stays installed across restarts.

(Developers: run python3 build.py to rebuild the .zip/.xpi from source — see Building.)

iOS Safari (userscript)

Safari on iOS doesn't support browser extensions like Firefox does, but there's a userscript build with the same matching logic at userscript/bonusradar.user.js that runs via a userscript manager.

  1. Install Userscripts (free) from the App Store, then enable it under Settings → Safari → Extensions.
  2. Open this link in Safari and tap Install when Userscripts prompts you: https://raw.githubusercontent.com/Godhet/bonusradar/main/userscript/bonusradar.user.js
  3. Visit a partner site — the widget should appear as a bar across the top of the page.

The userscript has no background page, so the shop list refreshes opportunistically (once a day, on whichever page you happen to be on) rather than on a fixed timer. To change your home country, tap the small country code shown on the left side of the banner.

Privacy

Matching happens locally against the cached index — the list of sites you visit is never sent anywhere. The extension makes network requests to:

  • LoyaltyKey, (a) once a day for the three market catalogs and (b) for a single shop's detail when you land on a partner site. Sent without credentials, so they're anonymous.
  • A handful of affiliate-network domains (TradeDoubler, Awin, Adtraction, Partner-ads, Adservice), once a day, as a no-cors "bait" request to detect whether an ad/content blocker would break bonus tracking. These carry no data and nothing is read from the response — only whether the request was allowed out.

Tests

node test/match.test.js

Building

python3 build.py

No transpiler, minifier, or bundler — the packaged files are byte-for-byte the source in this repo. The only per-browser difference is which manifest is used (manifest.json for Firefox, manifest.chrome.json for Chrome); everything else is shared. lib/compat.js aliases browserchrome so the same code runs in both.

Notes & credit

The browser-extension API endpoint and response shapes were identified from the open-source BonusVarsler project (github.com/kristofferR/BonusVarsler, GPL-3.0) — thanks to them for charting the path. This extension shares no code with it; it just calls the same public LoyaltyKey API. Not affiliated with SAS or EuroBonus.

License

MIT — see LICENSE.

Buy me a coffee?

No pressure, but if this saved you some EuroBonus points and you're feeling generous: ko-fi.com/socker

About

Flags SAS EuroBonus partner shops in Sweden, Norway and Denmark as you browse, so you can shop via the portal and actually earn points.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages