mirror of
https://github.com/SoPat712/videospeed.git
synced 2025-08-21 18:08:46 -04:00
Merge pull request #6 from ApoorvSaxena/master
added functionality to save default video speed in chrome sync storage
This commit is contained in:
11
inject.js
11
inject.js
@@ -8,9 +8,16 @@ chrome.extension.sendMessage({}, function(response) {
|
||||
this.video = target;
|
||||
this.initializeControls();
|
||||
|
||||
this.speedIndicator.textContent = this.getSpeed();
|
||||
chrome.storage.sync.get('speed', function(storage) {
|
||||
var speed = storage.speed ? storage.speed : '1.00';
|
||||
target.playbackRate = speed;
|
||||
this.speedIndicator.textContent = speed;
|
||||
}.bind(this));
|
||||
|
||||
this.video.addEventListener('ratechange', function(event) {
|
||||
this.speedIndicator.textContent = this.getSpeed();
|
||||
var speed = this.getSpeed();
|
||||
this.speedIndicator.textContent = speed;
|
||||
chrome.storage.sync.set({'speed': speed});
|
||||
}.bind(this));
|
||||
};
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "HTML5 Video Playback Speed Controller",
|
||||
"version": "0.1.1",
|
||||
"version": "0.1.2",
|
||||
"manifest_version": 2,
|
||||
"description": "Lean in and speed up your video learning with handy shortcuts to accelerate, slow-down, and rewind your video via your keyboard.",
|
||||
"homepage_url": "https://github.com/igrigorik/videospeed",
|
||||
@@ -9,7 +9,7 @@
|
||||
"48": "icons/icon48.png",
|
||||
"128": "icons/icon128.png"
|
||||
},
|
||||
"permissions": [ "activeTab" ],
|
||||
"permissions": [ "activeTab", "storage" ],
|
||||
"content_scripts": [{
|
||||
"all_frames": true,
|
||||
"matches": [ "http://*/*", "https://*/*"],
|
||||
@@ -17,4 +17,4 @@
|
||||
"js": [ "inject.js" ]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user