diff --git a/index.html b/index.html index c021709..1fb459d 100644 --- a/index.html +++ b/index.html @@ -60,7 +60,6 @@ -
- It seems like you are using an ad-blocker. Please disable it and reload the page. - We don't show any ads on this app and we don't track you. -
- ${isBrave ? html`If you have enabled Brave shield then disable it also.` : ''} - `) + document.body.prepend(document.createElement('adblocker-warning')) } else { notify(error, "error") } @@ -2566,6 +2556,73 @@ this.querySelector('#generated_private_key').value = '' } }); + const adBlockerWarning = document.createElement('template') + adBlockerWarning.innerHTML = ` + + + `; + window.customElements.define('adblocker-warning', class extends HTMLElement { + constructor() { + super(); + this.attachShadow({ mode: 'open' }); + this.shadowRoot.appendChild(adBlockerWarning.content.cloneNode(true)); + } + connectedCallback() { + const isBrave = navigator.brave !== undefined + this.shadowRoot.querySelector('#adblocker_warning').innerHTML = ` + ++ It seems like you are using an ad-blocker. Please disable it and reload the page. + We don't show any ads on this app and we don't track you. +
+ ${isBrave ? `If you have enabled Brave shield then disable it also.` : ''} + `; + } + });