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

Commit

Permalink
Merge pull request #7 from yongabyte/installation-link
Browse files Browse the repository at this point in the history
Installation link
  • Loading branch information
yongabyte authored Oct 1, 2020
2 parents 8eb9ae5 + 69e57b6 commit f3034a8
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ Make a browser that silently syncs the Favorites list on Radio Garden.
- Save the updated list everytime user updates their Favorites station list on Radio Garden.
- Sync it to their cloud.

## Techs Used
- Javascript
- Chrome API
### Installation Instructions

1. Download this repo as a ZIP file from GitHub.
1. Unzip the file and you should have a folder named favorite-radio.
1. In Chrome go to the extensions page (chrome://extensions).
1. Enable Developer Mode.
1. Drag the favorite-radio folder anywhere on the page to import it.
12 changes: 12 additions & 0 deletions contentScript.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ chrome.runtime.onMessage.addListener(
function(request, sender, sendResponse) {
if (request.onInstall === true){
let ls = JSON.parse(localStorage.getItem("favorites-list"));
console.log(ls);
sendResponse({localList:ls});
}
if(request.remote){
Expand All @@ -14,12 +15,14 @@ chrome.runtime.onMessage.addListener(
if(!localStorage.getItem("favorites-list")){
chrome.runtime.sendMessage({askForRemote: true}, function(list) {
console.log(list);
localStorage.setItem('myCat', 'Tom');
if(list){
localStorage.setItem("favorites-list",JSON.stringify(list));
}
});
}


let addFavor = "icon-button mod-favorite mod-interactive mod-hide-border mod-no-hover";
let removeFavor = "icon-button mod-favorite mod-interactive mod-active mod-hide-border mod-no-hover";

Expand Down Expand Up @@ -49,3 +52,12 @@ function onchanged(){
console.log("list updated");
});
}


function getCookies(domain, name, callback) {
chrome.cookies.get({"url": domain, "name": name}, function(cookie) {
if(callback) {
callback(cookie.value);
}
});
}
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"content_scripts": [
{
"matches": ["http://radio.garden/*"],
"matches": ["*://radio.garden/*"],
"js": ["contentScript.js"]
}
],
Expand Down
Binary file added packaged/favorite-radios.crx
Binary file not shown.

0 comments on commit f3034a8

Please sign in to comment.