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 = []; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
So so fantastic thank you!!!! Ill review mdn :)