diff options
author | Teddy Wing | 2020-05-06 01:04:31 +0200 |
---|---|---|
committer | Teddy Wing | 2020-05-06 01:04:31 +0200 |
commit | 1970a744ef186ae136e63d534314bc45a9a4f621 (patch) | |
tree | fb5666bbed4a57611abfd411a90e9cba728404cf | |
parent | 50859155dff9a85645dbfddf166ed888756be107 (diff) | |
download | netflix-immersive-1970a744ef186ae136e63d534314bc45a9a4f621.tar.bz2 |
styles: Fix `stylesheet` is `null` error
I had initialised the `stylesheet` variable before the element existed
in the DOM.
-rw-r--r-- | src/styles.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/styles.ts b/src/styles.ts index a9997cf..940ff30 100644 --- a/src/styles.ts +++ b/src/styles.ts @@ -1,9 +1,10 @@ export function styles () { var style = document.createElement('style'); - var stylesheet = style.sheet as CSSStyleSheet; document.head.appendChild(style); + var stylesheet = style.sheet as CSSStyleSheet; + stylesheet.insertRule( '.OriginalsPostPlay-BackgroundTrailer .BackToBrowse { visibility: hidden; }', stylesheet.cssRules.length |