Gmail Unsubscribe Github issues

Unsubscribe by pressing \

Mint 2023.12.22.. Lásd a legutóbbi verzió

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Gmail Unsubscribe Github issues
// @namespace    http://tampermonkey.net/
// @version      0.1.3
// @license      MIT
// @description  Unsubscribe by pressing \
// @match        https://mail.google.com/*
// @icon         https://www.google.com/s2/favicons?domain=tampermonkey.net
// @require https://cdn.jsdelivr.net/npm/@violentmonkey/shortcut@1
// @grant        none
// ==/UserScript==

function unsubscribe() {
    const link = Array.from(document.querySelectorAll('a[href^="https://github.com/notifications/unsubscribe-auth/"]')).findLast(node => node.innerText === 'unsubscribe');
    console.log(link);
    if (!link) {
      console.log("no link");
      return;
    }
    //link.click();
    //console.log("link click");
    let tabControl = GM_openInTab(link.href, true);
    console.log("link open");
    tabControl.close;
}

(function() {
    'use strict';

    //document.addEventListener('keypress', unsubscribe);
    //const { register } = VM.shortcut;
    VM.shortcut.register("\\", unsubscribe);
})();