cyber-circle-creator/js/url.js
2024-11-14 22:09:04 +00:00

16 lines
No EOL
620 B
JavaScript

document.addEventListener("DOMContentLoaded", function() {
function getFediverseHandle() {
const url = window.location.href;
const prefix = "?@";
const index = url.indexOf(prefix);
if(index !== -1) {
return decodeURIComponent(url.substring(index + prefix.length));
}
return null;
}
var fediverseHandle = getFediverseHandle();
if(fediverseHandle) {
document.getElementById('txt_mastodon_handle').value = fediverseHandle;
(async() => await circleMain())();
}
});