Fix some some popups still opening; remove obsolete code

tests
Lars 2022-11-16 17:04:19 +01:00 zatwierdzone przez GitHub
rodzic 70521ccc79
commit d98f42552f
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 2 dodań i 5 usunięć

Wyświetl plik

@ -54,10 +54,6 @@ function processButton() {
$(document).ready(function() {
// check if we are on a mastodon site with a handle in url
if (($("head").text().includes("mastodon") || $("head").text().includes("Mastodon") || $("div#mastodon").length) && window.location.href.includes("@")) {
for (const selector of buttonPaths) {
$(selector).attr("target","_self");
$(selector).attr("href","#");
}
// wait until follow button appears
waitForEl(buttonPaths, function(found) {
// grab the user handle
@ -67,6 +63,7 @@ function processButton() {
// setup the button click listener
$(found).click(function(e) {
e.preventDefault();
e.stopImmediatePropagation();
// wait until overlay apepars, then click in top left corner to close it (see comment above)
waitForEl(["div.modal-root div.modal-root__overlay"], function(foundoverlay) {
click(0,0);
@ -141,4 +138,4 @@ chrome.storage.local.get(['mastodonhomeinstance'], function(fetchedData) {
}
}
});
});
});