Fixed a problem that caused tabs to reload pages
This commit is contained in:
@ -52,6 +52,7 @@ export class AnimeNotifier {
|
||||
// Never remove src property on diffs
|
||||
Diff.persistentAttributes.add("src")
|
||||
|
||||
// Is intersection observer supported?
|
||||
if("IntersectionObserver" in window) {
|
||||
// Enable lazy load
|
||||
this.visibilityObserver = new IntersectionObserver(
|
||||
@ -451,6 +452,11 @@ export class AnimeNotifier {
|
||||
element.removeEventListener(oldAction.trigger, oldAction.handler)
|
||||
}
|
||||
|
||||
// This prevents default actions on links
|
||||
if(actionTrigger === "click" && element.tagName === "A") {
|
||||
element.onclick = null
|
||||
}
|
||||
|
||||
if(!(actionName in actions)) {
|
||||
this.statusMessage.showError(`Action '${actionName}' has not been defined`)
|
||||
continue
|
||||
|
Reference in New Issue
Block a user