Skip to content

Commit

Permalink
Add experimentation reload
Browse files Browse the repository at this point in the history
  • Loading branch information
jalagari authored Apr 25, 2024
1 parent 8865871 commit 6856803
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions scripts/editor-support.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,12 @@ async function applyChanges(event) {

}


function handleReloadPage(event) {
const a = document.createElement('a');
a.setAttribute('href', event.detail);
event.target.append(a);
a.click();
}


function attachEventListners(main) {
Expand All @@ -107,6 +112,7 @@ function attachEventListners(main) {
const applied = await applyChanges(event);
if (!applied) window.location.reload();
}));
main.addEventListener('extension:reloadPage', handleReloadPage);
}

attachEventListners(document.querySelector('main'));
attachEventListners(document.querySelector('main'));

0 comments on commit 6856803

Please sign in to comment.