Comments (5)
I haven't tested on typescript yet, so the scaffolding won't auto convert yet. But I think if you add vue-cli-plugin-typescript
and you manually convert files to lang="ts"
it should build fine. Definitely needs to be added to the roadmap, as it is fairly simple to convert files to TS after generation.
from vue-cli-plugin-browser-extension.
i tested.
it is ok. but i have to use background.js and content-script.js.
i have 1 more error. it is 'global is not defined'
i am using crypto from nodejs. base vue-cli is fine. but i had an error after i added this module.
thank you.
from vue-cli-plugin-browser-extension.
Until I get TS integrated, you could adjust the webpack chain similar to how I have done here in your own vue.config.js
. You'd delete my 'background'
entry and add your own referencing the background.ts
file instead of background.js
, and then the same thing for the content script.
Concerning your other error, could you paste in some relevant lines of code or steps to reproduce?
from vue-cli-plugin-browser-extension.
When I put in the below code onto popup.js, a 'global is not defined' error occurs.
popup.js
const crypto = require('crypto');
function encrypt(text, cryptoKey) {
const sha256 = crypto.createHash('sha256');
sha256.update(cryptoKey.toString());
// Initialization Vector
const iv = crypto.randomBytes(16);
const cipher = crypto.createCipheriv('aes-256-ctr', sha256.digest(), iv);
const ciphertext = cipher.update(Buffer.from(JSON.stringify(text)));
return Buffer.concat([iv, ciphertext, cipher.final()]).toString('base64');
}
console.log(encrypt('123', '123'));
When I put in 'global = window;' onto the very top of dist/popup/popup.js, the error goes away.
Is there a way to fix this?
Thank you.
from vue-cli-plugin-browser-extension.
I was able to find a solution to the above.
If you look at the 33rd line of index.js, it shows as below:
webpackConfig.node.global = false
By modifying to the below, I was able to solve the problem.
webpackConfig.node.global = true
Is there a way to add <script src+'test.js'></script> to popup.html?
I'm asking because the code gets deleted once it's built?
Thank you in advance.
from vue-cli-plugin-browser-extension.
Related Issues (20)
- Conflict with `webextension-polyfill-ts` HOT 1
- add support for Manifest v3 HOT 39
- How to load css from tailwind inside shadowRoot ? HOT 3
- Cannot read property 'getCurrent' of undefined" HOT 1
- Bundled production-ready CSS filename in manifest.json HOT 9
- Output background.js in /dist/background.js HOT 3
- Does it support Vue3? HOT 1
- Doesn't work with code splitting (file.split is not a function) HOT 5
- browser.extension null HOT 7
- Source Map Errors HOT 1
- Webpack 5 support? HOT 5
- HMR for popup
- Allow for non-string objects in the `content_security_policy` field. HOT 4
- Sorry but what's standalone mean HOT 1
- Remove browser polyfill not work HOT 1
- TypeError: Cannot read properties of undefined (reading 'ignore') HOT 9
- Is this project dead? HOT 10
- manifest.json not copying correctly HOT 2
- MV3 live reload not working on chrome-extension://jxxxxxxxxxxxxxxxxxxxk/popup.html
- Advanced Extension Reloader
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-cli-plugin-browser-extension.