1
0
mirror of https://github.com/yattee/yattee.git synced 2024-12-15 06:40:32 +05:30
yattee/Open in Yattee/content.js

18 lines
417 B
JavaScript
Raw Normal View History

2021-10-24 18:01:10 +05:30
if (document.readyState !== 'complete') {
2022-06-30 22:11:09 +05:30
window.addEventListener('load', redirect);
2021-10-24 18:01:10 +05:30
} else {
2022-06-30 22:11:09 +05:30
redirect();
2021-10-24 18:01:10 +05:30
}
function yatteeUrl() {
return window.location.href.replace(/^https?:\/\//, 'yattee://');
}
function yatteeLink() {
return '<a href="'+ yatteeUrl() +'" onclick=\'window.location.href="'+ yatteeUrl() +'"\'>Open in Yattee</a>';
}
function redirect() {
window.location.href = yatteeUrl()
}