Skip to content

Commit

Permalink
fix embed video
Browse files Browse the repository at this point in the history
  • Loading branch information
ttop32 committed Dec 30, 2023
1 parent ef0c6ad commit aa5a96f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/contentScript.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ $(async function initMouseTooltipTranslator() {
return;
}
await detectPDF(); //check current page is pdf
checkYoutube();
checkVideo();
checkGoogleDoc();
addElementEnv(); //add tooltip container
applyStyleSetting(); //add tooltip style
Expand Down Expand Up @@ -532,7 +532,7 @@ async function requestRecordTooltipText(

async function getSetting() {
setting = await util.loadSetting(function settingCallbackFn() {
checkYoutube();
checkVideo();
applyStyleSetting();
selectedText = "";
ocrView.removeAllOcrEnv();
Expand Down Expand Up @@ -698,7 +698,7 @@ function checkGoogleDoc() {
}

// youtube================================
async function checkYoutube() {
async function checkVideo() {
if (
!matchUrl(document.location.href, "www.youtube.com") ||
setting["enableYoutube"] == "null"
Expand Down
2 changes: 1 addition & 1 deletion src/subtitle/videoHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ async function getTranslatedSubtitle(baseUrl, lang) {
function getUrlParam(url) {
var vJson = {};
if (isShorts(url) || isEmbed(url)) {
vJson["v"] = url.match(/.*\/([^?]+)/)[1];
vJson["v"] = new URL(url).pathname.split("/")[2];
}

let params = new URL(url).searchParams;
Expand Down

0 comments on commit aa5a96f

Please sign in to comment.