Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: safari/ext/popup.js

Issue 5464830253203456: Refactored the abstraction layer to address prerendered pages on Safari caused by leaky abstraction (Closed)
Patch Set: Created Feb. 22, 2014, 10:45 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 (function() 1 (function()
2 { 2 {
3 // Safari doesn't adjust the size of the popover automatically to the size 3 // Safari doesn't adjust the size of the popover automatically to the size
4 // of its content, like when the ad counter is expanded/collapsed. So we add 4 // of its content, like when the ad counter is expanded/collapsed. So we add
5 // event listeners to do so. 5 // event listeners to do so.
6 var mayResize = true; 6 var mayResize = true;
7 7
8 var updateSize = function() 8 var updateSize = function()
9 { 9 {
10 if (mayResize) 10 if (mayResize)
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 // listener to do so. 48 // listener to do so.
49 safari.application.addEventListener("activate", function() 49 safari.application.addEventListener("activate", function()
50 { 50 {
51 safari.self.hide(); 51 safari.self.hide();
52 }, true); 52 }, true);
53 53
54 54
55 // import ext into the javascript context of the popover. This code might fail , 55 // import ext into the javascript context of the popover. This code might fail ,
56 // when the background page isn't ready yet. So it is important to put it belo w 56 // when the background page isn't ready yet. So it is important to put it belo w
57 // the reloading code above. 57 // the reloading code above.
58 var backgroundPage = safari.extension.globalPage.contentWindow; 58 window.ext = {
59 __proto__: safari.extension.globalPage.contentWindow.ext,
59 60
60 window.ext = {
61 __proto__: backgroundPage.ext,
62 closePopup: function() 61 closePopup: function()
63 { 62 {
64 safari.self.hide(); 63 safari.self.hide();
65 } 64 }
66 }; 65 };
67 window.TabMap = backgroundPage.TabMap;
68 })(); 66 })();
OLDNEW
« notification.js ('K') | « safari/ext/content.js ('k') | stats.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld