Add back Safari Extension

This commit is contained in:
Arkadiusz Fal
2022-06-30 18:41:09 +02:00
parent 51188cfc8e
commit 11984400fd
3 changed files with 71 additions and 28 deletions

View File

@@ -3,7 +3,7 @@
"default_locale": "en",
"name": "Open in Yattee",
"description": "Open YouTube videos in Yattee app",
"description": "Open videos in Yattee app",
"version": "1.0",
"icons": {

View File

@@ -1,7 +1,7 @@
if (document.readyState !== 'complete') {
window.addEventListener('load', redirectAndReplaceContentWithLink);
window.addEventListener('load', redirect);
} else {
redirectAndReplaceContentWithLink();
redirect();
}
function yatteeUrl() {
@@ -15,12 +15,3 @@ function yatteeLink() {
function redirect() {
window.location.href = yatteeUrl()
}
function replaceContentWithLink() {
document.querySelector('body').innerHTML = '<h1>' + yatteeLink() + '</h1>';
}
function redirectAndReplaceContentWithLink(){
redirect()
replaceContentWithLink()
}