Skip to content

Commit 09ff340

Browse files
committed
- fixed a bug causing duplication of the subtitle container
- changed extension name
1 parent a27d12c commit 09ff340

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/js/injectSubtitle.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,16 @@ function waitForVideoElement(subtitles) {
9191
function appendSubtitlesContainer(video) {
9292
if (typeof video !== "undefined") {
9393
var videoContainer = video.parentNode;
94-
var subsContainer = document.createElement("DIV");
95-
subsContainer.className = 'dbr dbnf-subs-container';
94+
var subsContainer
95+
if (!(subsContainer = videoContainer.querySelector('.dbnf-subs-container'))) {
96+
var subsContainer = document.createElement("DIV");
97+
subsContainer.className = 'dbr dbnf-subs-container';
98+
videoContainer.appendChild(subsContainer);
99+
}
96100
subsContainer.style.fontSize = (_textSizeBase + _subtitleSettings.fontSize).toString() + 'px';
97101
subsContainer.style.color = _subtitleSettings.fontColour;
98102
subsContainer.style.height = (1-_subtitleSettings.subHeight).toString() + '%';
99103
subsContainer.style.top = _subtitleSettings.subHeight.toString() + '%';
100-
videoContainer.appendChild(subsContainer);
101104
_subsContainer = subsContainer;
102105
//alwaysCheckThatSubtitlesContainerIsAppended();
103106
}

src/manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"manifest_version": 2,
3-
"name": "Just play - 为你连接豆瓣电影和Netflix",
4-
"short_name": "Just play",
3+
"name": "Netflix豆瓣电影助手",
4+
"short_name": "Netflix-豆瓣",
55
"version": "3.0",
66
"icons": {
77
"16": "img/logo@1x.png",

0 commit comments

Comments
 (0)