Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(261)

Side by Side Diff: ui/accessibility/extensions/colorenhancer/src/background.js

Issue 2775233003: Accessibility: Fix color enhancer filtering (Closed)
Patch Set: rebase Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * Adds filter script and css to all existing tabs. 6 * Adds filter script and css to all existing tabs.
7 * 7 *
8 * TODO(wnwen): Verify content scripts are not being injected multiple times. 8 * TODO(wnwen): Verify content scripts are not being injected multiple times.
9 */ 9 */
10 function injectContentScripts() { 10 function injectContentScripts() {
11 chrome.windows.getAll({'populate': true}, function(windows) { 11 chrome.windows.getAll({'populate': true}, function(windows) {
12 for (var i = 0; i < windows.length; i++) { 12 for (var i = 0; i < windows.length; i++) {
13 var tabs = windows[i].tabs; 13 var tabs = windows[i].tabs;
14 for (var j = 0; j < tabs.length; j++) { 14 for (var j = 0; j < tabs.length; j++) {
15 var url = tabs[j].url; 15 var url = tabs[j].url;
16 if (isDisallowedUrl(url)) { 16 if (isDisallowedUrl(url)) {
17 continue; 17 continue;
18 } 18 }
19 chrome.tabs.insertCSS(
20 tabs[j].id,
21 {file: 'res/cvd.css'});
22 chrome.tabs.executeScript( 19 chrome.tabs.executeScript(
23 tabs[j].id, 20 tabs[j].id,
24 {file: 'src/common.js'}); 21 {file: 'src/common.js'});
25 chrome.tabs.executeScript( 22 chrome.tabs.executeScript(
26 tabs[j].id, 23 tabs[j].id,
27 {file: 'src/cvd.js'}); 24 {file: 'src/cvd.js'});
28 } 25 }
29 } 26 }
30 }); 27 });
31 } 28 }
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 sendResponse(msg); 79 sendResponse(msg);
83 } 80 }
84 }); 81 });
85 82
86 //TODO(mustaq): Handle uninstall 83 //TODO(mustaq): Handle uninstall
87 84
88 document.addEventListener('storage', function(evt) { 85 document.addEventListener('storage', function(evt) {
89 updateTabs(); 86 updateTabs();
90 }, false); 87 }, false);
91 })(); 88 })();
OLDNEW
« no previous file with comments | « ui/accessibility/extensions/colorenhancer/res/cvd.css ('k') | ui/accessibility/extensions/colorenhancer/src/cvd.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698