Skip to content
This repository has been archived by the owner on Feb 10, 2023. It is now read-only.

Commit

Permalink
v0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
krmax44 committed Jun 25, 2017
1 parent 055e1a5 commit dd9d93f
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
22 changes: 22 additions & 0 deletions background.js
@@ -0,0 +1,22 @@
chrome.webRequest.onBeforeRequest.addListener(
function(details) {
if (details.url.startsWith("https://open.spotify.com/")) {
var parser = document.createElement("a");
parser.href = details.url;

if (parser.pathname.startsWith("/album/")) {
var redirect = "https://krmax44.de/playify/?type=album&q=" + parser.pathname.split("/")[2];
return { redirectUrl: redirect };
} else if (parser.pathname.startsWith("/artist/")) {
var redirect = "https://krmax44.de/playify/?type=artist&q=" + parser.pathname.split("/")[2];
return { redirectUrl: redirect };
} else if (parser.pathname.startsWith("/track/")) {
var redirect = "https://krmax44.de/playify/?type=track&q=" + parser.pathname.split("/")[2];
return { redirectUrl: redirect };
}
}
}, {
urls: ["*://*.spotify.com/*"],
types: ["main_frame"]
}, ["blocking"]
);
Binary file added icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions manifest.json
@@ -0,0 +1,15 @@
{
"manifest_version": 2,
"name": "Playify",
"description": "Play Spotify tracks in Google Play Music",
"version": "0.1",
"browser_action": {
"default_icon": "icon.png"
},
"background": {"scripts":["background.js"]},
"permissions": [
"webRequest", "webRequestBlocking",
"*://*.spotify.com/*",
"https://krmax44.de/playify/*"
]
}

0 comments on commit dd9d93f

Please sign in to comment.