| Left: | ||
| Right: |
| LEFT | RIGHT |
|---|---|
| 1 (function() | 1 (function() |
| 2 { | 2 { |
|
Thomas Greiner
2012/09/26 15:49:13
bracket on first line (as seen on last line)
Wladimir Palant
2012/09/27 14:55:06
Not really how I usually write it...
| |
| 3 function getModuleGlobal(module) | 3 function getModuleGlobal(module) |
| 4 { | 4 { |
| 5 let result = Cu.getGlobalForObject(require(module)); | 5 let result = Cu.getGlobalForObject(require(module)); |
| 6 if (result == window) | 6 if (result == window) |
| 7 { | 7 { |
| 8 // Work-around for bug 736316 - getGlobalForObject gave us our own window | 8 // Work-around for bug 736316 - getGlobalForObject gave us our own window |
| 9 let {XPIProvider} = Cu.import("resource://gre/modules/XPIProvider.jsm", nu ll); | 9 let {XPIProvider} = Cu.import("resource://gre/modules/XPIProvider.jsm", nu ll); |
| 10 let addonID = "{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}" | 10 let addonID = "{0fa2149e-bb2c-4ac2-a8d3-479599819475}"; |
|
Thomas Greiner
2012/09/26 15:49:13
semicolon is missing
Wladimir Palant
2012/09/27 14:55:06
Bigger issue actually - that's the ID for Adblock
| |
| 11 if (addonID in XPIProvider.bootstrapScopes) | 11 if (addonID in XPIProvider.bootstrapScopes) |
| 12 result = XPIProvider.bootstrapScopes[addonID]; | 12 result = XPIProvider.bootstrapScopes[addonID]; |
| 13 } | 13 } |
| 14 | 14 |
| 15 if ("require" in result) | 15 if ("require" in result) |
| 16 result = result.require.scopes[module]; | 16 result = result.require.scopes[module]; |
| 17 return result; | 17 return result; |
| 18 } | 18 } |
| 19 | 19 |
| 20 let {onWhitelistEntryAdded, onWhitelistEntryRemoved} = require("rules"); | 20 let {onWhitelistEntryAdded, onWhitelistEntryRemoved} = require("rules"); |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 196 "o": { | 196 "o": { |
| 197 "o": { | 197 "o": { |
| 198 "f": { | 198 "f": { |
| 199 }, | 199 }, |
| 200 "g": " 1234" | 200 "g": " 1234" |
| 201 } | 201 } |
| 202 } | 202 } |
| 203 }, "Attempted to remove goo"); | 203 }, "Attempted to remove goo"); |
| 204 }); | 204 }); |
| 205 })(); | 205 })(); |
| LEFT | RIGHT |