Skip to content

Commit d8b1a87

Browse files
committed
Optimized DOM observer
1 parent f31442e commit d8b1a87

File tree

3 files changed

+174
-158
lines changed

3 files changed

+174
-158
lines changed

content-scripts.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,12 @@ chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) {
188188
6.0 INITIALIZATION
189189
------------------------------------------------------------------------------*/
190190

191+
injectYoutubeScript();
192+
191193
chrome.runtime.sendMessage({
192194
name: 'migration'
193195
});
194196

195-
injectYoutubeScript();
196-
197197
chrome.storage.local.get('youtube_home_page', function (items) {
198198
var option = items.youtube_home_page;
199199

@@ -227,10 +227,6 @@ chrome.storage.local.get(function (items) {
227227
}
228228
});
229229

230-
chrome.runtime.sendMessage({
231-
enabled: true
232-
});
233-
234230
new MutationObserver(function (mutationList) {
235231
for (var i = 0, l = mutationList.length; i < l; i++) {
236232
var mutation = mutationList[i];
@@ -255,4 +251,8 @@ new MutationObserver(function (mutationList) {
255251
attributes: true,
256252
childList: false,
257253
subtree: false
254+
});
255+
256+
chrome.runtime.sendMessage({
257+
enabled: true
258258
});

manifest.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"name": "'Improve YouTube!' (Video & YouTube Tools)🎧",
44
"short_name": "ImprovedTube",
55
"description": "__MSG_description_ext__",
6-
"version": "3.843",
6+
"version": "3.850",
77
"default_locale": "en",
88
"icons": {
99
"128": "icons/128.png",
@@ -67,6 +67,10 @@
6767
}
6868
],
6969
"offline_enabled": true,
70+
"web_accessible_resources": [
71+
"ui/options.html",
72+
"youtube-scripts.js"
73+
],
7074
"optional_permissions": [
7175
"downloads"
7276
],

0 commit comments

Comments
 (0)