Skip to content

Commit

Permalink
fix: update popup menu selector and player container selector (#49)
Browse files Browse the repository at this point in the history
Co-authored-by: makfc <francis.mak.fc@gmail.com>
  • Loading branch information
gmertes and makfc authored Nov 13, 2021
1 parent ca3d4ec commit 00c3ad9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "NflxMultiSubs (Netflix Multi. Subtitles)",
"manifest_version": 2,
"author": "Dan Chen",
"version": "1.0",

"permissions": [
"storage",
Expand Down
4 changes: 2 additions & 2 deletions src/nflxmultisubs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"]')
);
};

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 00c3ad9

Please sign in to comment.