cyber-circle-creator/js/url.js

16 lines
620 B
JavaScript
Raw Normal View History

2024-11-14 22:09:04 +00:00
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())();
}
});