mirror of
https://github.com/yattee/yattee.git
synced 2024-11-10 08:18:19 +00:00
18 lines
417 B
JavaScript
18 lines
417 B
JavaScript
if (document.readyState !== 'complete') {
|
|
window.addEventListener('load', redirect);
|
|
} else {
|
|
redirect();
|
|
}
|
|
|
|
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()
|
|
}
|