From 859376e8e4797ff34635879cafbf0ed6c03e683c Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 19 May 2023 22:19:18 +0200 Subject: [PATCH] Translate bstlar.com bypass to MV3 --- src/bypasses/bstlar.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/bypasses/bstlar.js diff --git a/src/bypasses/bstlar.js b/src/bypasses/bstlar.js new file mode 100644 index 000000000..fe867d2e6 --- /dev/null +++ b/src/bypasses/bstlar.js @@ -0,0 +1,21 @@ +import BypassDefinition from './BypassDefinition.js' + +export default class Bstlar extends BypassDefinition { + constructor() { + super() + // custom bypass required bases can be set here + } + + execute() { + this.helpers.ensureDomLoaded(() => { + const boostellar_link = encodeURIComponent(location.pathname.slice(1)) + fetch(`https://bstlar.com/api/link?url=${boostellar_link}`).then(res => res.json().then((res) => { + if (res?.link?.destination_url) { + this.helpers.safelyNavigate(res.link.destination_url) + } + })) + }) + } +} + +export const matches = ['bstlar.com']