gameSelectionScript top-level constant

String const gameSelectionScript

Appends the selection lockdown once the DOM exists. A fixed id keeps it to one tag even if the page finishes twice. Port of Android GAME_SELECTION_SCRIPT (iOS injects the same CSS at document end).

Implementation

const String gameSelectionScript = '(function(){var c=$gameSelectionCssLiteral;'
    "function a(){if(document.getElementById('digia-selection'))return;"
    "var s=document.createElement('style');s.id='digia-selection';s.textContent=c;"
    '(document.head||document.documentElement).appendChild(s);}'
    "if(document.readyState==='loading'){document.addEventListener('DOMContentLoaded',a);}else{a();}})();";