aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2020-05-06 01:04:31 +0200
committerTeddy Wing2020-05-06 01:04:31 +0200
commit1970a744ef186ae136e63d534314bc45a9a4f621 (patch)
treefb5666bbed4a57611abfd411a90e9cba728404cf
parent50859155dff9a85645dbfddf166ed888756be107 (diff)
downloadnetflix-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.ts3
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