aboutsummaryrefslogtreecommitdiffstats
path: root/src/player.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/player.ts')
-rw-r--r--src/player.ts16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/player.ts b/src/player.ts
new file mode 100644
index 0000000..ea0e541
--- /dev/null
+++ b/src/player.ts
@@ -0,0 +1,16 @@
+export default function with_player (): Promise<HTMLElement> {
+ return new Promise(function(resolve) {
+ const interval = setInterval(
+ function() {
+ const player = document.querySelector('.NFPlayer.nf-player-container');
+
+ if (player) {
+ clearInterval(interval);
+
+ resolve(player);
+ }
+ },
+ 1000
+ );
+ });
+}