Chrome extension — will my source code be available to users?

谁说我不能喝 提交于 2019-12-24 06:55:07

问题


I'm about to release my first chrome extension to chrome web store. They want the code to be zipped and uploaded. And once through approval it will be available to users as .crx files, if I understand it correctly.

But these crx files are simple zip file with .crx extension right? If so, won't users be able to get hold of the source code?

Which means, I may get to see 100 more versions of my source code floating around the web store alongside my extension. :(

Is there anyway to prevent the user from getting hold of the source code?


回答1:


Providing source code to your extensions is the simplest way to give something back to the open source community. Since you are using at least one open source application (Chrome) you should think about open-sourcing your projects as paying back the debt.

You should also understand that github/bitbucket profile is a developer portfolio. Many companies look at these before offering a job. Nowadays, each and every good developer has an extensive list of open source projects. This allows anyone to get an idea of how good is the code they write, how well they can collaborate with other developers, how much attention do they pay to the details etc.

Last but not least, if your extension is really good, if you constantly maintain it and develop new features and your users enjoy using it, you may be sure that it will defend itself from any kind of copies. If you open source your code you'll surely find some collaborators that will provide translations, new features and will help you to fix the bugs.

Anyway, an answer to your question is this: if you are afraid that someone will use your JavaScript code you can obfuscate it. Of course, obfuscated code can be pritified by someone who is desperate to read it but without the comments and meaningful variable names it will be a pain to do so. Other solution is to write a NPAPI plugin or Native Client app because these allow you to compile parts of the code.



来源:https://stackoverflow.com/questions/13063689/chrome-extension-will-my-source-code-be-available-to-users

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!