refactor: ts rewrite content script & background script

This commit is contained in:
abhijithvijayan 2020-01-27 19:43:42 +05:30
parent b3ddb80e99
commit 7070a49f7c
4 changed files with 3 additions and 16 deletions

1
src/Background/index.ts Normal file
View File

@ -0,0 +1 @@
console.log('this is background scripts file');

View File

@ -1,14 +0,0 @@
import browser from 'webextension-polyfill';
browser.runtime.onInstalled.addListener(() => {
// eslint-disable-next-line no-console
console.log('onInstalled....');
});
browser.runtime.onMessage.addListener((request, sender, sendResponse) => {
// Do something with the message!
alert(request.url);
// And respond back to the sender.
return Promise.resolve('got your message, thanks!');
});

View File

@ -52,8 +52,8 @@ module.exports = {
mode: nodeEnv,
entry: {
background: './src/scripts/background.js',
contentScript: './src/scripts/contentScript.js',
background: path.join(sourcePath, 'Background', 'index.ts'),
contentScript: path.join(sourcePath, 'ContentScript', 'index.ts'),
popup: './src/scripts/popup.js',
options: './src/scripts/options.js',
styles: [path.join(sourcePath, 'Popup', 'popup.scss'), path.join(sourcePath, 'Options', 'options.scss')],