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

Unified Diff: chrome/common/extensions/docs/examples/extensions/speak_selection/tabs.js

Issue 8114011: Add sample extensions that use the text-to-speech (TTS) API. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/docs/examples/extensions/speak_selection/tabs.js
===================================================================
--- chrome/common/extensions/docs/examples/extensions/speak_selection/tabs.js (revision 0)
+++ chrome/common/extensions/docs/examples/extensions/speak_selection/tabs.js (revision 0)
@@ -0,0 +1,28 @@
+function sendKeyToAllTabs(keyStr) {
+ chrome.windows.getAll({'populate': true}, function(windows) {
+ for (var i = 0; i < windows.length; i++) {
+ var tabs = windows[i].tabs;
+ for (var j = 0; j < tabs.length; j++) {
+ chrome.tabs.sendRequest(
+ tabs[j].id,
+ {'key': keyStr});
+ }
+ }
+ });
+}
+
+function loadContentScriptInAllTabs() {
+ chrome.windows.getAll({'populate': true}, function(windows) {
+ for (var i = 0; i < windows.length; i++) {
+ var tabs = windows[i].tabs;
+ for (var j = 0; j < tabs.length; j++) {
+ chrome.tabs.executeScript(
+ tabs[j].id,
+ {file: 'keycodes.js', allFrames: true});
+ chrome.tabs.executeScript(
+ tabs[j].id,
+ {file: 'content_script.js', allFrames: true});
+ }
+ }
+ });
+}
Property changes on: chrome/common/extensions/docs/examples/extensions/speak_selection/tabs.js
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698