Skip to content

Commit

Permalink
Initial functionality works (still prototype)
Browse files Browse the repository at this point in the history
  • Loading branch information
SleekPanther committed Jul 10, 2018
1 parent c4bff9d commit cb42f11
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
15 changes: 15 additions & 0 deletions background.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

const MAGIC_URL_POSTFIX = '&list=ULcxqQ59vzyTk'

chrome.browserAction.onClicked.addListener((tab)=>{
//chrome.tabs.executeScript(null, {file: "testScript.js"})
chrome.tabs.query({'active': true, 'lastFocusedWindow': true}, (tabs)=>{
let currentTab = tabs[0]
let oldURL = currentTab.url
console.log('url=', oldURL)


let newUrl = oldURL + MAGIC_URL_POSTFIX
chrome.tabs.update(currentTab.id, {url: newUrl})
})
})
30 changes: 30 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"manifest_version": 2,

"name": "YouTube Chronological Order",
"description": "Watch YouTube videos in chronological order from any channel",
"version": "0.1.0",
"version_name": "0.1.0",

"browser_action": {
// "default_icon": "assets/icons/icon.png",
"default_title": "Watch videos in chronological order"
},
"permissions": [
"activeTab",
"tabs"
],
"background": {
"scripts": [
"background.js"
]
},
"commands": {
"appendToUrl": {
"suggested_key": {
"default": "Alt+P"
},
"description": "Watch all videos from channel in chronological order"
}
}
}

0 comments on commit cb42f11

Please sign in to comment.