Created
January 24, 2019 18:56
-
-
Save Fiaxhs/536be635470b18ea76ccb6c288ab444a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Spotify app only | |
// @namespace com.fiaxhs | |
// @description Launch app, kill that web player (with fire) | |
// @include https://play.spotify.com* | |
// @include https://open.spotify.com* | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
// Firefox users: (you'll need GreaseMonkey) | |
// 1. open about:config | |
// 2. search "dom.allow_scripts_to_close_windows" | |
// 3. set it to true. | |
// Chrome users: | |
// 1. save this as a file (ending in `user.js`) | |
// 2. open chrome://extensions/ and drop said file | |
// If nothing happens, try to open a spotify URI ( like spotify:track:4uLU6hMCjMI75M1A2tKUQC ) | |
// in your browser, and choose to open Spotify app | |
if (matches = /(album|track|user\/[^\/]*\/playlist)\/([^\?]*)/.exec(window.location)) { | |
window.location = 'spotify:' + matches[1] + ':' + matches[2]; | |
window.setTimeout(() => window.close(), 500); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment