mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-10 13:37:04 +03:00
Update content.js
This commit is contained in:
@@ -78,12 +78,11 @@ chrome.storage.sync.get(["dontShowNoticeAgain"], function(result) {
|
|||||||
//get messages from the background script and the popup
|
//get messages from the background script and the popup
|
||||||
chrome.runtime.onMessage.addListener(messageListener);
|
chrome.runtime.onMessage.addListener(messageListener);
|
||||||
|
|
||||||
|
window.addEventListener("hashchange", function(event){
|
||||||
|
if(id = getYouTubeVideoID(document.URL)) videoIDChange(id);
|
||||||
|
});
|
||||||
|
|
||||||
function messageListener(request, sender, sendResponse) {
|
function messageListener(request, sender, sendResponse) {
|
||||||
//message from background script
|
|
||||||
if (request.message == "TabUpdate") {
|
|
||||||
if(id = getYouTubeVideoID(document.URL)) videoIDChange(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
//messages from popup script
|
//messages from popup script
|
||||||
if (request.message == "sponsorStart") {
|
if (request.message == "sponsorStart") {
|
||||||
sponsorMessageStarted(sendResponse);
|
sponsorMessageStarted(sendResponse);
|
||||||
|
|||||||
Reference in New Issue
Block a user