Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building the sourcecode #378

Closed
thany opened this issue May 7, 2019 · 5 comments
Closed

Building the sourcecode #378

thany opened this issue May 7, 2019 · 5 comments

Comments

@thany
Copy link

@thany thany commented May 7, 2019

Description

I can build the source code, but it's not producing a usable result. It produces a collection of JS files and a css folder, which is hardly a useful result. For starters, a collection of JS files is not a browser addon...

Expected Behavior

I was expecting an XPI file for Firefox at least, and similar addons packages for other browsers.

Actual Behavior

A dist folder with JS files.

Steps to Reproduce

  1. Clone the repo
  2. yarn install --frozen-lockfile
  3. yarn upgrade
  4. yarn run build.prod

Exactly as described in the readme.

Versions

  • Browser: N/A
  • OS: Windows 10
  • Node: 10.13
  • NPM: 6.4.1
  • Yarn: 1.15.2
@Eden12345
Copy link
Contributor

@Eden12345 Eden12345 commented May 7, 2019

Hey @thany, thanks for reaching out. To clarify, this process for building the source code is designed for local development.

Once you've followed the steps in the "Installation" and "Building" sections of the README.md, you can load your extension into Firefox using the process outlined here: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Your_first_WebExtension

Basically, after you've built the extension, you need to head to the Add-ons section of the Firefox browser (which you can navigate to in the URL bar by entering about:addons). Then click the settings wheel, and from that menu select Debug Add-ons. Lastly, click Load Temporary Add-on... and select any file from within the extension's root directory (eg. manifest.json).

You can also load the extension into Chrome following a similar process. Head to the "Extensions" section of the browser (chrome://extensions/) and turn on the Developer mode toggle. Then click Load unpacked and select the root directory of the extension. You can learn more about developing extensions for Chrome here: https://developer.chrome.com/extensions/getstarted

@Eden12345 Eden12345 closed this May 7, 2019
@thany
Copy link
Author

@thany thany commented May 8, 2019

No, it's not solved yet, don't close this ticket so eagerly ;)

Shouldn't there also be a step to build a production-ready addon file? I've set the build script to build for production: yarn run build.prod

And indeed, my goal is not development. My goal is to build the extension myself and install it like I would from addons.mozilla.org. So how do I do that? Surely, you do that as well, and whatever it is you do for that, should be part of the "build for production" process.

@Eden12345
Copy link
Contributor

@Eden12345 Eden12345 commented May 9, 2019

If you would like to install a production build of an extension as you would from https://addons.mozilla.org/en-US/firefox/extensions/, you would have to create a build and submit it to Mozilla for their approval before it could be released to the store (see: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Package_your_extension_ and https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/Distribution/Submitting_an_add-on). While our source code is accessible on GitHub, it is still copyrighted and this form of distribution would violate the terms of our license (see: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/Distribution#Code_disputes).

Apologies for any confusion there. The yarn run build.prod script you're running prepares the source code in a way that reflects a production build, but is not intended for a production release or other forms of distribution. We make our source code available so that you can clone the repository, understand its functionality, manipulate it (in case you like to make a pull request), and build it locally to preview how any changes you've made would affect it. While we have a "Building" section of our README.md that explains how to build the source code for local development, we do not provide any way of building our source code for a production release, as the latter is something we do on our end.

I'm going to keep this issue closed as it is not a bug report, nor is it a feature request for the Ghostery extension itself.

@thany
Copy link
Author

@thany thany commented May 16, 2019

I'm not going to publish it. I just want to build the extension in such a way that it becomes an installable file. That step is missing from the script or documentation.

Why is that so much to ask??

@Eden12345
Copy link
Contributor

@Eden12345 Eden12345 commented May 16, 2019

When we submit a build to Mozilla for release, we submit it as a regular ZIP file for them to build into an XPI on their end, as the docs that I linked in my previous message explain. Since building the extension into an XPI is not part of our development or release process, we cannot prioritize adding an XPI builder into our repository at this time.

If you would like to build the extension into a CRX file, which is the file type used to load extensions in the Google Chrome browser, then you can use the "Pack extension" option in the Extensions section there (please see my initial response if you need help navigating to that page).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants