diff --git a/src/CustomElements/CustomElements.js b/src/CustomElements/CustomElements.js index 8ef94e6..14d33c6 100644 --- a/src/CustomElements/CustomElements.js +++ b/src/CustomElements/CustomElements.js @@ -18,7 +18,10 @@ var flags = {}; if (!flags.noOpts) { location.search.slice(1).split('&').forEach(function(o) { o = o.split('='); - o[0] && (flags[o[0]] = o[1] || true); + var m; + if (o[0] && (m = o[0].match(/wc-(.+)/))) { + flags[m[1]] = o[1] || true; + } }); } diff --git a/src/HTMLImports/HTMLImports.js b/src/HTMLImports/HTMLImports.js index 2b76f5d..e357f1f 100644 --- a/src/HTMLImports/HTMLImports.js +++ b/src/HTMLImports/HTMLImports.js @@ -18,7 +18,10 @@ var flags = {}; if (!flags.noOpts) { location.search.slice(1).split('&').forEach(function(o) { o = o.split('='); - o[0] && (flags[o[0]] = o[1] || true); + var m; + if (o[0] && (m = o[0].match(/wc-(.+)/))) { + flags[m[1]] = o[1] || true; + } }); } diff --git a/src/WebComponents/build/boot-lite.js b/src/WebComponents/build/boot-lite.js index 4c3a6f4..f78eb7e 100644 --- a/src/WebComponents/build/boot-lite.js +++ b/src/WebComponents/build/boot-lite.js @@ -11,10 +11,10 @@ window.WebComponents = window.WebComponents || {}; // process flags (function(scope){ - + // import var flags = scope.flags || {}; - + var file = 'webcomponents-lite.js'; var script = document.querySelector('script[src*="' + file + '"]'); @@ -23,7 +23,10 @@ window.WebComponents = window.WebComponents || {}; // from url location.search.slice(1).split('&').forEach(function(o) { o = o.split('='); - o[0] && (flags[o[0]] = o[1] || true); + var m; + if (o[0] && (m = o[0].match(/wc-(.+)/))) { + flags[m[1]] = o[1] || true; + } }); // from script if (script) { @@ -48,7 +51,7 @@ window.WebComponents = window.WebComponents || {}; // Determine default settings. // If any of these flags match 'native', then force native ShadowDOM; any // other truthy value, or failure to detect native - // ShadowDOM, results in polyfill + // ShadowDOM, results in polyfill flags.shadow = (flags.shadow || flags.shadowdom || flags.polyfill); if (flags.shadow === 'native') { flags.shadow = false; diff --git a/src/WebComponents/build/boot.js b/src/WebComponents/build/boot.js index 54c662f..c7164ea 100644 --- a/src/WebComponents/build/boot.js +++ b/src/WebComponents/build/boot.js @@ -23,7 +23,10 @@ window.WebComponents = window.WebComponents || {}; // from url location.search.slice(1).split('&').forEach(function(o) { o = o.split('='); - o[0] && (flags[o[0]] = o[1] || true); + var m; + if (o[0] && (m = o[0].match(/wc-(.+)/))) { + flags[m[1]] = o[1] || true; + } }); // from script if (script) { diff --git a/webcomponents-lite.js b/webcomponents-lite.js index b7a8d29..08034ca 100644 --- a/webcomponents-lite.js +++ b/webcomponents-lite.js @@ -23,7 +23,10 @@ // from url location.search.slice(1).split('&').forEach(function(o) { o = o.split('='); - o[0] && (flags[o[0]] = o[1] || true); + var m; + if (o[0] && (m = o[0].match(/wc-(.+)/))) { + flags[m[1]] = o[1] || true; + } }); // from script if (script) { diff --git a/webcomponents.js b/webcomponents.js index 8112c73..4c632f7 100644 --- a/webcomponents.js +++ b/webcomponents.js @@ -23,7 +23,10 @@ // from url location.search.slice(1).split('&').forEach(function(o) { o = o.split('='); - o[0] && (flags[o[0]] = o[1] || true); + var m; + if (o[0] && (m = o[0].match(/wc-(.+)/))) { + flags[m[1]] = o[1] || true; + } }); // from script if (script) {