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: Addressed comments Created April 11, 2014, 2:47 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « safari/ext/content.js ('k') | stats.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 var resizingScheduled = false; 7 var resizingScheduled = false;
8 8
9 var updateSize = function() 9 var updateSize = function()
10 { 10 {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 // listener to do so. 56 // listener to do so.
57 safari.application.addEventListener("activate", function() 57 safari.application.addEventListener("activate", function()
58 { 58 {
59 safari.self.hide(); 59 safari.self.hide();
60 }, true); 60 }, true);
61 61
62 62
63 // import ext into the javascript context of the popover. This code might fail , 63 // import ext into the javascript context of the popover. This code might fail ,
64 // when the background page isn't ready yet. So it is important to put it belo w 64 // when the background page isn't ready yet. So it is important to put it belo w
65 // the reloading code above. 65 // the reloading code above.
66 var backgroundPage = safari.extension.globalPage.contentWindow; 66 window.ext = {
67 __proto__: safari.extension.globalPage.contentWindow.ext,
67 68
68 window.ext = {
69 __proto__: backgroundPage.ext,
70 closePopup: function() 69 closePopup: function()
71 { 70 {
72 safari.self.hide(); 71 safari.self.hide();
73 } 72 }
74 }; 73 };
75 window.TabMap = backgroundPage.TabMap;
76 })(); 74 })();
OLDNEW
« no previous file with comments | « safari/ext/content.js ('k') | stats.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld