Created
May 22, 2015 11:08
-
-
Save luckyrat/7803415810fb4c09c975 to your computer and use it in GitHub Desktop.
importGlobalProperties test JSM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// JSM for working out which globalproperties can be imported in a specific Firefox version. | |
// https://developer.mozilla.org/en-US/docs/Components.utils.importGlobalProperties | |
// I'm not certain availability always equates to functionality but it probably does | |
// and in any case it's a way to narrow down the more involved test for functionality of each property | |
// Run from browser toolbox scratchpad like: | |
// Components.utils.import("resource://test-importGlobalProperties-addon/test.jsm"); | |
Components.utils.import("resource://gre/modules/devtools/Console.jsm"); | |
let props = ["does-not-exist", "atob", "Blob", "btoa", "crypto", "CSS", "File", | |
"indexedDB", "rtcIdentityProvider", "TextDecoder", "TextEncoder", | |
"URL", "URLSearchParams", "XMLHttpRequest" ]; | |
for (let prop of props) | |
{ | |
try { | |
Components.utils.importGlobalProperties([].concat(prop)); | |
console.log(prop + " available"); | |
} catch (e) | |
{ | |
console.log(e); | |
} | |
} | |
var EXPORTED_SYMBOLS = []; |
FF 31.6.0ESR (Win7):
"UNAVAILABLE:" "does-not-exist" Scratchpad/1:34
"atob available" Scratchpad/1:30
"UNAVAILABLE:" "Blob" Scratchpad/1:34
"btoa available" Scratchpad/1:30
"UNAVAILABLE:" "crypto" Scratchpad/1:34
"UNAVAILABLE:" "CSS" Scratchpad/1:34
"UNAVAILABLE:" "File" Scratchpad/1:34
"indexedDB available" Scratchpad/1:30
"UNAVAILABLE:" "rtcIdentityProvider" Scratchpad/1:34
"TextDecoder available" Scratchpad/1:30
"TextEncoder available" Scratchpad/1:30
"URL available" Scratchpad/1:30
"UNAVAILABLE:" "URLSearchParams" Scratchpad/1:34
"XMLHttpRequest available" Scratchpad/1:30
FF28 and FF29 (win7) - identical results:
[object Error] Scratchpad/1:23
"atob available" Scratchpad/1:20
[object Error] Scratchpad/1:23
"btoa available" Scratchpad/1:20
[object Error] Scratchpad/1:23
[object Error] Scratchpad/1:23
[object Error] Scratchpad/1:23
"indexedDB available" Scratchpad/1:20
[object Error] Scratchpad/1:23
"TextDecoder available" Scratchpad/1:20
"TextEncoder available" Scratchpad/1:20
"URL available" Scratchpad/1:20
[object Error] Scratchpad/1:23
"XMLHttpRequest available" Scratchpad/1:20
So so fantastic thank you!!!! Ill review mdn :)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
FF32 (Win7)