OLD | NEW |
(Empty) | |
| 1 <script> |
| 2 chrome.extension.onConnect.addListener(function(port) { |
| 3 chrome.test.log("got connect"); |
| 4 port.onMessage.addListener(function(msg) { |
| 5 chrome.test.log("got message: " + msg); |
| 6 chrome.test.assertEq(2, msg); |
| 7 chrome.test.notifyPass(); |
| 8 }); |
| 9 }); |
| 10 |
| 11 chrome.tabs.onUpdated.addListener(function(tabId, changeInfo) { |
| 12 chrome.test.log("Got update event: " + JSON.stringify(changeInfo)); |
| 13 if (changeInfo.status == "complete") { |
| 14 chrome.tabs.executeScript(tabId, {file: "c.js"}); |
| 15 chrome.tabs.onUpdated.removeListener(arguments.callee); |
| 16 } |
| 17 }); |
| 18 |
| 19 chrome.test.log("Creating tab..."); |
| 20 chrome.tabs.create({ |
| 21 url: "http://localhost:1337/files/extensions/test_file.html" |
| 22 }); |
| 23 </script> |
OLD | NEW |