mirror of
https://github.com/SoPat712/YTLitePlus.git
synced 2025-08-21 18:48:45 -04:00
added files via upload
This commit is contained in:
25
Extensions/OpenYoutubeSafariExtension.appex/content.js
Normal file
25
Extensions/OpenYoutubeSafariExtension.appex/content.js
Normal file
@@ -0,0 +1,25 @@
|
||||
browser.runtime.sendMessage({ greeting: "hello" }).then((response) => {
|
||||
console.log("Received response: ", response);
|
||||
});
|
||||
|
||||
browser.runtime.onMessage.addListener((request, sender, sendResponse) => {
|
||||
console.log("Received request: ", request);
|
||||
});
|
||||
|
||||
function afterNavigate() {
|
||||
if ('/watch' === location.pathname) {
|
||||
window.location.href = `youtube://${window.location.pathname.slice(1)}${
|
||||
window.location.search
|
||||
}${window.location.hash}`;
|
||||
}
|
||||
}
|
||||
(document.body || document.documentElement).addEventListener('transitionend',
|
||||
function(/*TransitionEvent*/ event) {
|
||||
if (event.propertyName === 'width' && event.target.id === 'progress') {
|
||||
afterNavigate();
|
||||
}
|
||||
}, true);
|
||||
// After page load
|
||||
afterNavigate();
|
||||
|
||||
|
Reference in New Issue
Block a user