Yarn
Alert window asking for permission to Read and change all your data on all websites
permissions
and host_permissions
sections like this:
mellowtel
package.
Note: The service worker is also known as background script
.
You can copy and paste the following code into your service worker file by changing the configuration_key
with your own key.
Service worker code breakdown
Mellowtel(configuration_key, options?)
to create a new instance of the Mellowtel object. The Mellowtel object is your entrypoint to the rest of Mellowtel’s SDK. Your configuration_key
is required when calling this function, as it identifies your extension to Mellowtel. You can find your configuration_key
in the dashboardinitBackground
method. This method will initialize the Mellowtel object and set up the necessary listeners.all_frames
and <all_urls>
at the document_start
.
We suggest creating a new content script (e.g. content_start_mellowtel.js) where you can copy and paste the following code.
Change the configuration_key
with your own key.
manifest.json
file in the content_scripts section alongside any other content script you already have.
You can copy and paste the following code by changing the name_of_your_content_script.js
with the name you chose.
service worker
file (also known as background script) and add the following code:
generateSettingsLink()
.
This method will return a link that will open the Mellowtel settings page where users can decide at any time if they want to opt-in or opt-out.
This link should be placed inside the popup, options page or any other place where users can easily access it.
For example you can put it in a openSettings()
function like this. You can call openSettings()
on a button click or any other relevant event: