Facebook
From DJ Blyatman, 1 Month ago, written in JavaScript.
Embed
Download Paste or View Raw
Hits: 171
  1. // ==UserScript==
  2. // @name         Spotify Premium Link Opener
  3. // @namespace    http://tampermonkey.net/
  4. // @version      0.1
  5. // @description  Open Spotify premium links in a new tab
  6. // @author       You
  7. // @match        *://*.spotify.com/*
  8. // @grant        none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12.     'use strict';
  13.  
  14.     // Function to open links in a new tab
  15.     function openLinkInNewTab(url) {
  16.         window.open(url, '_blank');
  17.     }
  18.  
  19.     // Find all premium links on the page
  20.     var premiumLinks = document.querySelectorAll('a[href*="/premium"]');
  21.  
  22.     // Loop through the links and open them in a new tab
  23.     for (var i = 0; i < premiumLinks.length; i++) {
  24.         var link = premiumLinks[i];
  25.         openLinkInNewTab(link.href);
  26.     }
  27. })();