Skip to content

Commit 6231b5f

Browse files
committed
✨ Add extension's icons
1 parent 19d76af commit 6231b5f

File tree

5 files changed

+27
-18
lines changed

5 files changed

+27
-18
lines changed

icons/icon128.png

18.5 KB
Loading

icons/icon16.png

1.32 KB
Loading

icons/icon48.png

5.21 KB
Loading

manifest.json

+12-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,25 @@
11
{
22
"name": "Video Commander",
3-
"version": "1.0",
3+
"version": "0.1",
44
"manifest_version": 2,
5-
6-
"description": "Add some handy shortcuts on all HTML5 video sites",
5+
"description": "Video Commander provides keyboard shortcuts to loop, speed up, speed down, rewind time, advance time and other handy actions",
6+
"homepage_url": "https://github.com/noraworld/videocommander",
7+
"icons": {
8+
"16": "icons/icon16.png",
9+
"48": "icons/icon48.png",
10+
"128": "icons/icon128.png"
11+
},
712

813
"permissions": [
914
"activeTab", "storage"
1015
],
1116

1217
"options_page": "options.html",
1318

19+
"browser_action": {
20+
"default_icon": "icons/icon128.png"
21+
},
22+
1423
"content_scripts": [
1524
{
1625
"all_frames": true,

script.js

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
chrome.extension.sendMessage({}, function(response) {
1+
$(function() {
2+
23
var settings = {
34
// オプションで変更可能なキーコード
45
togglePlayAndPauseKeyCode: 'p',
@@ -51,20 +52,18 @@ chrome.extension.sendMessage({}, function(response) {
5152
var getVideoTimeoutID;
5253

5354
// video要素を取得する
54-
$(function() {
55-
function getVideoElement() {
56-
if (document.getElementsByTagName('video')[0] !== undefined) {
57-
player = document.getElementsByTagName('video')[0];
58-
clearTimeout(getVideoTimeoutID);
59-
observeSpeed();
60-
return false;
61-
}
62-
getVideoTimeoutID = setTimeout(function() {
63-
getVideoElement();
64-
}, 10);
65-
};
66-
getVideoElement();
67-
});
55+
function getVideoElement() {
56+
if (document.getElementsByTagName('video')[0] !== undefined) {
57+
player = document.getElementsByTagName('video')[0];
58+
clearTimeout(getVideoTimeoutID);
59+
observeSpeed();
60+
return false;
61+
}
62+
getVideoTimeoutID = setTimeout(function() {
63+
getVideoElement();
64+
}, 10);
65+
};
66+
getVideoElement();
6867

6968
// キーが押されたかどうかを判定
7069
window.addEventListener('keydown', function(event) {
@@ -339,4 +338,5 @@ chrome.extension.sendMessage({}, function(response) {
339338
}
340339
return speedStatus.toFixed(1);
341340
};
341+
342342
});

0 commit comments

Comments
 (0)