mirror of
https://github.com/mdn/webextensions-examples.git
synced 2026-04-17 06:48:37 +02:00
Add an example on how to use webpack with webextensions
This commit is contained in:
6
webpack-modules/background_scripts/background.js
Normal file
6
webpack-modules/background_scripts/background.js
Normal file
@@ -0,0 +1,6 @@
|
||||
const leftPad = require("left-pad");
|
||||
|
||||
chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
|
||||
const result = leftPad(message.text, message.amount, message.with);
|
||||
sendResponse(result);
|
||||
});
|
||||
Reference in New Issue
Block a user