1/** 2 * @license 3 * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. 4 * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt 5 * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt 6 * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt 7 * Code distributed by Google as part of the polymer project is also 8 * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt 9 */ 10 11(function () { 12 13 'use strict'; 14 15 // Establish scope. 16 window['WebComponents'] = window['WebComponents'] || { 'flags': {} }; 17 18 var flagMatcher = /wc-(.+)/; 19 20 // Flags. Convert url arguments to flags 21 var flags = {}; 22 if (!flags['noOpts']) { 23 // from url 24 location.search.slice(1).split('&').forEach(function (option) { 25 var parts = option.split('='); 26 var match; 27 if (parts[0] && (match = parts[0].match(flagMatcher))) { 28 flags[match[1]] = parts[1] || true; 29 } 30 }); 31 } 32 33 // exports 34 window['WebComponents']['flags'] = flags; 35 var forceShady = flags['shadydom']; 36 if (forceShady) { 37 window['ShadyDOM'] = window['ShadyDOM'] || {}; 38 window['ShadyDOM']['force'] = forceShady; 39 } 40 41 var forceCE = flags['register'] || flags['ce']; 42 if (forceCE && window['customElements']) { 43 window['customElements']['forcePolyfill'] = forceCE; 44 } 45 46 var forceShimCss = flags['shimcssproperties']; 47 if (forceShimCss) { 48 window['ShadyCSS'] = window['ShadyCSS'] || {}; 49 window['ShadyCSS']['shimcssproperties'] = true; 50 } 51 52 window['WebComponents']['ready'] = true; 53 54})();