xcv58 / Custom-JavaScript-for-Websites-2

Run custom JavaScript on any website
https://xcv58.xyz/inject-js
MIT License
181 stars 46 forks source link

Add "Export as Extension" button #85

Open mallove opened 4 years ago

mallove commented 4 years ago

Not sure if something like this is feasible or worthwhile, but is there a way to export the custom javascript from this extension to a standalone extension?

Screen Shot 2019-11-20 at 11 30 18 AM

So this Export as Extension button exports a zip file containing a manifest, a basic options page, etc.

xcv58 commented 4 years ago

It's totally feasible. But I'm not sure whether it's worthwhile. Because below reasons:

  1. The standalone extension needs some metadata like name, version, author, permission, etc. In order to do this, we need to add some UI to input such information.
  2. It's not immediately useable by just exporting a zip file. You need to register a chrome extension developer account (and pay the one-time registration fee) and publish it to the web store.
  3. After publishing to the web store, once you need to update the extension, you have to input all the fields again and maintain a proper version number. Otherwise, you can keep an old exported zip file and update it manually. But if one decides to do this, use another git repo seems a better approach.
mallove commented 4 years ago

It's totally feasible. But I'm not sure whether it's worthwhile. Because below reasons:

  1. The standalone extension needs some metadata like name, version, author, permission, etc. In order to do this, we need to add some UI to input such information.
  2. It's not immediately useable by just exporting a zip file. You need to register a chrome extension developer account (and pay the one-time registration fee) and publish it to the web store.
  3. After publishing to the web store, once you need to update the extension, you have to input all the fields again and maintain a proper version number. Otherwise, you can keep an old exported zip file and update it manually. But if one decides to do this, use another git repo seems a better approach.

Gotcha.

Maybe what I'm looking for is a central location for users to share useful CJS snippets ( a library, wiki, tips page?) E.g., I dislike those twitter share popovers that all the WordPress sites are using, so the below one-liner removes them from some sites. But I wonder if others have a better way of dealing with them.

$('#share-div").remove();
xcv58 commented 4 years ago

For the purpose, I suggest the Tampermonkey https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo?hl=en

and you can find and share scripts through these websites: https://www.tampermonkey.net/scripts.php