diff --git a/_layouts/default.html b/_layouts/default.html index 55cf05b..3527956 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -11,6 +11,7 @@ content script <-> page script messaging
+export helpers
diff --git a/export-helpers.html b/export-helpers.html new file mode 100644 index 0000000..5dc8252 --- /dev/null +++ b/export-helpers.html @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/page-scripts/export-helpers.js b/page-scripts/export-helpers.js new file mode 100644 index 0000000..69e44e0 --- /dev/null +++ b/page-scripts/export-helpers.js @@ -0,0 +1,12 @@ + +const button1 = document.querySelector("#function-notify"); + +button1.addEventListener("click", () => { + window.notify("Message from the page script!"); +}); + +const button2 = document.querySelector("#object-notify"); + +button2.addEventListener("click", () => { + window.messenger.notify("Message from the page script!"); +});