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

Side by Side Diff: options.js

Issue 8679008: Huge hack: Opera doesn`t fire an unload event, make sure we can deal with that (Closed)
Patch Set: Created Oct. 24, 2012, 8:48 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Opera hack: wrap onFilterChange to make sure it won't get called after page
2 // unload (Opera doesn't fire the unload event).
3 var origOnFilterChange = window.onFilterChange;
4 window.onFilterChange = function()
5 {
6 if (typeof document.createElement("dummy") === "undefined")
7 {
8 var event = document.createEvent("Events");
9 event.initEvent("unload", false, false);
10 window.dispatchEvent(event);
11 return undefined;
12 }
13 else
14 return origOnFilterChange.apply(this, arguments);
15 }
16
1 var backgroundPage = opera.extension.bgProcess; 17 var backgroundPage = opera.extension.bgProcess;
2 var require = backgroundPage.require; 18 var require = backgroundPage.require;
3 19
4 with(require("filterClasses")) 20 with(require("filterClasses"))
5 { 21 {
6 this.Filter = Filter; 22 this.Filter = Filter;
7 this.WhitelistFilter = WhitelistFilter; 23 this.WhitelistFilter = WhitelistFilter;
8 } 24 }
9 with(require("subscriptionClasses")) 25 with(require("subscriptionClasses"))
10 { 26 {
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 if (subscription.disabled == !enabled.checked) 607 if (subscription.disabled == !enabled.checked)
592 return; 608 return;
593 609
594 subscription.disabled = !enabled.checked; 610 subscription.disabled = !enabled.checked;
595 }, false); 611 }, false);
596 612
597 updateSubscriptionInfo(element); 613 updateSubscriptionInfo(element);
598 614
599 document.getElementById("filterLists").appendChild(element); 615 document.getElementById("filterLists").appendChild(element);
600 } 616 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld