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

Side by Side Diff: chrome/test/data/extensions/samples/subscribe_page_action/background.html

Issue 196015: Try again to fix bug 20968, this time not breaking browser (Closed)
Patch Set: Created 11 years, 3 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 <html> 1 <html>
2 <head> 2 <head>
3 <script> 3 <script>
4 // The Page Action ID. 4 // The Page Action ID.
5 var pageActionId = "RssPageAction"; 5 var pageActionId = "RssPageAction";
6 6
7 // The icon to use. This corresponds to the icon listed in the manifest. 7 // The icon to use. This corresponds to the icon listed in the manifest.
8 var subscribeId = 0; 8 var subscribeId = 0;
9 9
10 // A dictionary keyed off of tabId that keeps track of data per tab (for 10 // A dictionary keyed off of tabId that keeps track of data per tab (for
(...skipping 25 matching lines...) Expand all
36 chrome.pageActions["RssPageAction"].addListener(function(pageActionId, 36 chrome.pageActions["RssPageAction"].addListener(function(pageActionId,
37 pageActionInfo) { 37 pageActionInfo) {
38 chrome.windows.getCurrent(function(window) { 38 chrome.windows.getCurrent(function(window) {
39 chrome.tabs.get(pageActionInfo.tabId, function(tab) { 39 chrome.tabs.get(pageActionInfo.tabId, function(tab) {
40 // We need to know if we are the active window, because the tab may 40 // We need to know if we are the active window, because the tab may
41 // have moved to another window and we don't want to execute this 41 // have moved to another window and we don't want to execute this
42 // action multiple times. 42 // action multiple times.
43 if (window.focused) { 43 if (window.focused) {
44 // Create a new tab showing the subscription page with the right 44 // Create a new tab showing the subscription page with the right
45 // feed URL. 45 // feed URL.
46 chrome.tabs.create({url: "subscribe.html?" + 46 var url = "subscribe.html?" +
47 feedData[pageActionInfo.tabId].feedUrl, 47 encodeURIComponent(feedData[pageActionInfo.tabId].feedUrl);
48 windowId: window.windowId}); 48 chrome.tabs.create({url: url, windowId: window.windowId});
49 } 49 }
50 }); 50 });
51 }); 51 });
52 }); 52 });
53 53
54 chrome.tabs.onRemoved.addListener(function(reply) { 54 chrome.tabs.onRemoved.addListener(function(reply) {
55 feedData[reply.tabId] = null; 55 feedData[reply.tabId] = null;
56 }); 56 });
57 </script> 57 </script>
58 </head> 58 </head>
59 </html> 59 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698