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

Unified Diff: chrome/test/data/extensions/good/Extensions/bjafgdebaacbbbecmhlhpofkepfkgcpa/1.0/page.js

Issue 339064: Add new user script injection point: document_idle. (Closed)
Patch Set: smaller, cleaner, better Created 11 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/test/data/extensions/good/Extensions/bjafgdebaacbbbecmhlhpofkepfkgcpa/1.0/page.js
diff --git a/chrome/test/data/extensions/good/Extensions/bjafgdebaacbbbecmhlhpofkepfkgcpa/1.0/page.js b/chrome/test/data/extensions/good/Extensions/bjafgdebaacbbbecmhlhpofkepfkgcpa/1.0/page.js
index 34d27fc654bde11b1cd333c5753e78f3ab7ae655..8fc4a94ed6a8b94282ad15a399f364b2749f6763 100644
--- a/chrome/test/data/extensions/good/Extensions/bjafgdebaacbbbecmhlhpofkepfkgcpa/1.0/page.js
+++ b/chrome/test/data/extensions/good/Extensions/bjafgdebaacbbbecmhlhpofkepfkgcpa/1.0/page.js
@@ -3,28 +3,26 @@ if (typeof(contentWindow) != 'undefined') {
win = contentWindow;
}
-win.onload = function() {
- // Do this in an onload handler because I'm not sure if chrome.extension
- // is available before then.
- chrome.extension.onConnect.addListener(function(port) {
- console.log('connected');
- port.onMessage.addListener(function(msg) {
- console.log('got ' + msg);
- if (msg.testPostMessage) {
- port.postMessage({success: true});
- } else if (msg.testPostMessageFromTab) {
- testPostMessageFromTab(port);
- } else if (msg.testDisconnect) {
- port.disconnect();
- } else if (msg.testDisconnectOnClose) {
- win.location = "about:blank";
- } else if (msg.testPortName) {
- port.postMessage({portName:port.name});
- }
- // Ignore other messages since they are from us.
- });
+// Do this in an onload handler because I'm not sure if chrome.extension
Matt Perry 2009/11/02 19:46:30 remove this comment
+// is available before then.
+chrome.extension.onConnect.addListener(function(port) {
+ console.log('connected');
+ port.onMessage.addListener(function(msg) {
+ console.log('got ' + msg);
+ if (msg.testPostMessage) {
+ port.postMessage({success: true});
+ } else if (msg.testPostMessageFromTab) {
+ testPostMessageFromTab(port);
+ } else if (msg.testDisconnect) {
+ port.disconnect();
+ } else if (msg.testDisconnectOnClose) {
+ win.location = "about:blank";
+ } else if (msg.testPortName) {
+ port.postMessage({portName:port.name});
+ }
+ // Ignore other messages since they are from us.
});
-};
+});
// Tests that postMessage to the extension and its response works.
function testPostMessageFromTab(origPort) {

Powered by Google App Engine
This is Rietveld 408576698