This feature requires Mellowtel version 1.6.2 or higher. This is a breaking change compared to previous versions.
Installation
First, install the required npm package using your preferred package manager:Using npm
Using yarn
Using pnpm
Standard Implementation
1. Create an HTML file named pascoli.html
Create a file named pascoli.html and add the following code. Make sure this file gets included in your final build (/dist) directory.
If you followed the initial webpack config setup, you can simply add this file to the public directory as pascoli.html
Make sure to modify the
src attribute of the script tag to point to the correct location of your pascoli.js file in the final build2. Create a JavaScript file named pascoli.js
In the src directory, or wherever you have js files, create a file named pascoli.js and add the following code. Ensure this file gets included in your final build (/dist) directory.
If you followed the initial webpack config setup, you can simply add this file to the entry object in your webpack config.
3. Update your webpack config
Make sure your final build directory includes thepascoli.html and pascoli.js files.
Add the following to your webpack config to ensure pascoli.js is included in the build:
pascoli.html should be included in your build directory as well automatically if you followed the initial webpack config setup and added it to the public directory.
4. Update manifest.json
Add thepascoli.html file to your manifest.json as web_accessible_resources:
Plasmo Framework Implementation
If you’re using the Plasmo framework, follow these alternative steps:1. Create PascoliPage Component
Create a file namedpascoli.tsx in your tabs directory. If you don’t have a tabs directory, create one. More info on tabs in the Plasmo framework can be found here. Add the following code to the pascoli.tsx file:
2. Update package.json for Plasmo
Add the following to yourpackage.json file:
Update initContentScript
For both implementations, modify yourinitContentScript method in the content script to include the correct path to the Pascoli file: