aboutsummaryrefslogtreecommitdiff
/**
 * SPDX-License-Identifier: CC0-1.0
 *
 * Copyright (C) 2025 Woj. Kosior <koszko@koszko.org>
 */

/*
  #+begin_src manifest-jq
  .matches = ["<all_urls>"]
  #+end_src
*/

if (false) { /* #+begin_src background-js */
    blockJsOnHeader(
        /^via$/,
        /\sgit[.]gammaspectra[.]live[/]git[/]go-away/
    );
} /* #+end_src */

const goAwayJsRegex =
      /^\s*window[.]location\s*=\s*("[^"]+[/]go-away[/][^"]+")\s*;\s*$/;

for (const script of document.scripts) {
    const match = goAwayJsRegex.exec(script.textContent);
    if (match) {
        window.location = JSON.parse(match[1]);
        break;
    }
}