Fix __onGCastApiAvailable being called early

This commit is contained in:
hensm
2019-03-21 14:37:36 +00:00
parent 2a327573da
commit d0129f66b7
4 changed files with 24 additions and 16 deletions

View File

@@ -35,3 +35,15 @@ export function getWindowCenteredProps (
// tslint:disable-next-line:max-line-length
export const REMOTE_MATCH_PATTERN_REGEX = /^(?:(?:(\*|https?|ftp):\/\/(\*|(?:\*\.(?:[^\/\*:]\.?)+(?:[^\.])|[^\/\*:]*))?)(\/.*)|<all_urls>)$/;
export function loadScript (
scriptUrl: string
, doc: Document = document): HTMLScriptElement {
const scriptElement = doc.createElement("script");
scriptElement.src = scriptUrl;
(doc.head || doc.documentElement).append(scriptElement);
return scriptElement;
}