- Notifications
You must be signed in to change notification settings - Fork0
create your own userscript with modern technology powered by webpack
License
oe/webpack-userscript-template
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Userscript developed with modern tech powered by webpack
This template is based onWebpack andwebpack-userscript, written in typescript.
I recommend you usingChrome andTampermonkey to develop a user script. Following steps are based on these two tools.
- create your own repo by click the green buttonUse this template
- install a user script manager for your browser, Tampermonkey is recommended for Chrome, for more alternatives just checkgreasyfork
- enable insecure localhost: navigate to
chrome://flags/#allow-insecure-localhost, enable insecure localhost - enable file url access of extensions: navigate to
chrome://extensions/?id=dhdgffkkebhmkfjojejmpbldmpobfkfo(Chrome manage extensions page ofTampermonkey) and enableAllow access to file URLs(you need to manual reload page when dev userscript, see#475 for more detail)
- install dependencies by run
yarn(ornpm i) - open dev server by run
yarn dev(ornpm run dev) - <https://127.0.0.1/[your userscript name].proxy.user.js> will be open automatically in browser(click
Advanced->proceedif it shows a security warning) to install the proxy script. by settingopenScriptInstallPagetofalseinuserscript.config.tsyou can turn off this behavior. - open your target webpage to see the effect. by setting
openTargetPageto as your target url inuserscript.config.tsit will open that page automatically for you. - config userscript by modifying
userscript.config.ts, you need to rerunyarn devto make it take effect - config webpack by modifying
webpack.config.ts, you need to rerunyarn devto make it take effect - reload your target webpage after userscript changed
run cmdyarn build(ornpm run build), your userscript should be indist folder with extension.user.js
after your script fully tested, you can build it than publish it to the world. here are some platform your can share your script:
notice: userscript name(which can be configured viascriptHeaders.name inwebpack.config.ts) is a script's identity, you should not change it's name after published.
About
create your own userscript with modern technology powered by webpack
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.