From 00c3ad99098651ec15edcd480bf04380737a1478 Mon Sep 17 00:00:00 2001 From: Gert Mertes <13658335+gmertes@users.noreply.github.com> Date: Sat, 13 Nov 2021 16:37:23 +0800 Subject: [PATCH] fix: update popup menu selector and player container selector (#49) Co-authored-by: makfc --- src/manifest.json | 1 + src/nflxmultisubs.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/manifest.json b/src/manifest.json index f3a4475..2587669 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -2,6 +2,7 @@ "name": "NflxMultiSubs (Netflix Multi. Subtitles)", "manifest_version": 2, "author": "Dan Chen", + "version": "1.0", "permissions": [ "storage", diff --git a/src/nflxmultisubs.js b/src/nflxmultisubs.js index a2b9f3b..8893e4a 100644 --- a/src/nflxmultisubs.js +++ b/src/nflxmultisubs.js @@ -450,7 +450,7 @@ class SubtitleMenu { const isPopupMenuElement = node => { return ( node.nodeName.toLowerCase() === 'div' && - node.classList.contains('audio-subtitle-controller') + node.querySelector('div[data-uia="selector-audio-subtitle"]') ); }; @@ -824,7 +824,7 @@ class RendererLoop { // @returns {boolean} Successed? _appendSubtitleWrapper() { if (!this.subtitleWrapperElem || !this.subtitleWrapperElem.parentNode) { - const playerContainerElem = document.querySelector('.nf-player-container'); + const playerContainerElem = document.querySelector('div[data-uia="video-canvas"]'); if (!playerContainerElem) return false; this.subtitleWrapperElem = buildSecondarySubtitleElement(gRenderOptions); playerContainerElem.appendChild(this.subtitleWrapperElem);