-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5c0d363
commit ee63bbe
Showing
3 changed files
with
50 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
chrome.tabs.onUpdated.addListener((tabId, changeInfo, tab) => { | ||
if (changeInfo.status === 'complete' && tab.url.indexOf("https://www.youtube.com/watch?v=") !== -1) { | ||
chrome.scripting.executeScript({ | ||
target: { | ||
"tabId": tabId, | ||
"allFrames": true | ||
}, | ||
files: ["move_heart.js"], | ||
}); | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,31 @@ | ||
const jsInitCheckTimer = setInterval(jsLoaded, 1000); | ||
const archive_message = [ | ||
"上位のチャットのリプレイ", | ||
"チャットのリプレイ" | ||
]; | ||
{ | ||
const jsInitCheckTimer = setInterval(jsLoaded, 1000); | ||
const archive_message = [ | ||
"上位のチャットのリプレイ", | ||
"チャットのリプレイ" | ||
]; | ||
|
||
function jsLoaded() { | ||
if (document.getElementById("chatframe") !== null && document.getElementById("chatframe").contentWindow.document.getElementById("reaction-control-panel") != null) { | ||
//Stream now | ||
clearInterval(jsInitCheckTimer); | ||
function jsLoaded() { | ||
if (document.getElementById("chatframe") !== null && document.getElementById("chatframe").contentWindow.document.getElementById("reaction-control-panel") != null) { | ||
//Stream now | ||
clearInterval(jsInitCheckTimer); | ||
|
||
const heart = document.getElementById("chatframe").contentWindow.document.getElementById("reaction-control-panel"); | ||
heart.style.position = "absolute"; | ||
heart.style.top = "35px"; | ||
heart.style.rifht = "0px"; | ||
} | ||
else if (document.getElementById("chatframe") !== null && document.getElementById("chatframe").contentWindow.document.getElementById('label-text') !== null && archive_message.includes(document.getElementById("chatframe").contentWindow.document.getElementById('label-text').textContent)){ | ||
//Archive | ||
clearInterval(jsInitCheckTimer); | ||
} | ||
else if (document.getElementById("message") !== null && document.getElementById("message").textContent === "この動画ではチャットのリプレイを利用できません。"){ | ||
//Archive(edit) | ||
clearInterval(jsInitCheckTimer); | ||
} | ||
else if (document.getElementById("info-container") !== null && document.getElementById("info-container").textContent.indexOf("配信") == -1 && document.getElementById("info-container").textContent.indexOf("配信開始") !== -1){ | ||
//Movie | ||
clearInterval(jsInitCheckTimer); | ||
const heart = document.getElementById("chatframe").contentWindow.document.getElementById("reaction-control-panel"); | ||
heart.style.position = "absolute"; | ||
heart.style.top = "35px"; | ||
heart.style.rifht = "0px"; | ||
} | ||
else if (document.getElementById("chatframe") !== null && document.getElementById("chatframe").contentWindow.document.getElementById('label-text') !== null && archive_message.includes(document.getElementById("chatframe").contentWindow.document.getElementById('label-text').textContent)) { | ||
//Archive | ||
clearInterval(jsInitCheckTimer); | ||
} | ||
else if (document.getElementById("message") !== null && document.getElementById("message").textContent === "この動画ではチャットのリプレイを利用できません。") { | ||
//Archive(edit) | ||
clearInterval(jsInitCheckTimer); | ||
} | ||
else if (document.getElementById("info-container") !== null && document.getElementById("info-container").textContent.indexOf("配信") == -1 && document.getElementById("info-container").textContent.indexOf("配信開始") !== -1) { | ||
//Movie | ||
clearInterval(jsInitCheckTimer); | ||
}; | ||
}; | ||
}; | ||
} |