ken107 / read-aloud

An awesome browser extension that reads aloud webpage content with one click
https://readaloud.app
MIT License
1.39k stars 236 forks source link

can you provide the instruction of how to build xpi (or include it in the release?) #201

Closed SmartLayer closed 3 years ago

SmartLayer commented 3 years ago

Hi 1.38 is released but since it's not on the Mozilla add-on site, I downloaded from the release. There is a tar.gz and zip, but not any XPI files. I first thought that might be a 'source release' and you might need to download it first and run something like npm buildXpi but couldn't find any instruction for that.

Then I started exploring typing various things, like npm build, npm test, npm run etc finally I got this:

$ npm run-script package

> read-aloud@1.0.0 package /tmp/read-aloud-ff-1.38.0
> zip -u -r build/package.zip _locales css img js sound *.html manifest.json || true

    zip warning: build/package.zip not found or empty
zip I/O error: No such file or directory
zip error: Could not create output file (build/package.zip)

Upon inspection it seems this is because build directory doesn't exist - seems like I missed a build step.

Even if I manually create the said directory, the resulting package.zip isn't recognised by Firefox as a valid addon (even after renaming it to package.xpi):

$ npm run-script package

> read-aloud@1.0.0 package /tmp/read-aloud-ff-1.38.0
> zip -u -r build/package.zip _locales css img js sound *.html manifest.json || true

    zip warning: build/package.zip not found or empty
  adding: _locales/ (stored 0%)
  adding: _locales/es/ (stored 0%)
  adding: _locales/es/messages.json (deflated 67%)
  adding: _locales/it/ (stored 0%)
  adding: _locales/it/messages.json (deflated 67%)
  adding: _locales/vi/ (stored 0%)
  adding: _locales/vi/messages.json (deflated 66%)
  adding: _locales/zh_CN/ (stored 0%)
  adding: _locales/zh_CN/messages.json (deflated 62%)
  adding: _locales/zh_TW/ (stored 0%)
  adding: _locales/zh_TW/messages.json (deflated 64%)
  adding: _locales/en/ (stored 0%)
  adding: _locales/en/messages.json (deflated 71%)
  adding: _locales/ja/ (stored 0%)
  adding: _locales/ja/messages.json (deflated 67%)
  adding: css/ (stored 0%)
  adding: css/images/ (stored 0%)
  adding: css/images/ui-bg_diagonals-small_40_db4865_40x40.png (deflated 16%)
  adding: css/images/ui-icons_c02669_256x240.png (deflated 6%)
  adding: css/images/ui-icons_ffffff_256x240.png (deflated 2%)
  adding: css/images/ui-bg_diagonals-small_50_93c3cd_40x40.png (deflated 16%)
  adding: css/images/ui-bg_white-lines_85_f7f7ba_40x100.png (deflated 38%)
  adding: css/images/ui-bg_diagonals-small_75_ccd232_40x40.png (deflated 16%)
  adding: css/images/ui-bg_dots-medium_80_ffff38_4x4.png (deflated 24%)
  adding: css/images/ui-bg_diagonals-small_50_ff3853_40x40.png (deflated 16%)
  adding: css/images/ui-icons_454545_256x240.png (deflated 2%)
  adding: css/images/ui-icons_e1e463_256x240.png (deflated 6%)
  adding: css/images/ui-bg_dots-small_35_35414f_2x2.png (deflated 25%)
  adding: css/images/ui-icons_88a206_256x240.png (deflated 6%)
  adding: css/images/ui-icons_ffeb33_256x240.png (deflated 6%)
  adding: css/MaterialIcons-Regular.woff (deflated 0%)
  adding: css/options.css (deflated 68%)
  adding: css/popup.css (deflated 66%)
  adding: css/bootstrap.min.css (deflated 86%)
  adding: css/common.css (deflated 48%)
  adding: img/ (stored 0%)
  adding: img/icon-16.png (stored 0%)
  adding: img/icon.png (stored 0%)
  adding: img/icon-48.png (stored 0%)
  adding: img/loading.gif (deflated 9%)
  adding: js/ (stored 0%)
  adding: js/languages.js (deflated 72%)
  adding: js/custom-voices.js (deflated 76%)
  adding: js/speech.js (deflated 75%)
  adding: js/popup.js (deflated 72%)
  adding: js/tts-engines.js (deflated 88%)
  adding: js/defaults.js (deflated 70%)
  adding: js/content/ (stored 0%)
  adding: js/content/google-doc.js (deflated 68%)
  adding: js/content/google-drive-doc.js (deflated 54%)
  adding: js/content/googleDocsUtil.js (deflated 75%)
  adding: js/content/html-doc.js (deflated 68%)
  adding: js/content/khan-academy.js (deflated 52%)
  adding: js/content/kindle-book.js (deflated 63%)
  adding: js/content/google-drive-preview.js (deflated 53%)
  adding: js/content/vitalsource-book.js (deflated 54%)
  adding: js/content/google-play-book.js (deflated 62%)
  adding: js/content/pdf-doc.js (deflated 63%)
  adding: js/content/ixl.js (deflated 52%)
  adding: js/content/google-slides.js (deflated 60%)
  adding: js/google-translate.js (deflated 69%)
  adding: js/report.js (deflated 55%)
  adding: js/firefox-perm.js (deflated 51%)
  adding: js/content.js (deflated 65%)
  adding: js/jquery-3.1.1.min.js (deflated 65%)
  adding: js/messaging.js (deflated 70%)
  adding: js/options.js (deflated 72%)
  adding: js/document.js (deflated 75%)
  adding: js/events.js (deflated 69%)
  adding: sound/ (stored 0%)
  adding: sound/silence.mp3 (deflated 99%)
  adding: custom-voices.html (deflated 80%)
  adding: firefox-perm.html (deflated 54%)
  adding: languages.html (deflated 53%)
  adding: options.html (deflated 71%)
  adding: popup.html (deflated 68%)
  adding: report.html (deflated 58%)
  adding: shortcuts.html (deflated 54%)
  adding: manifest.json (deflated 54%)

Which makes me think maybe the resulting .zip file isn't intended for Firefox.

P. S. thanks for solving #199

ken107 commented 3 years ago

Hi, yes sorry Mozilla is taking some time to approve 1.38.

But there's a workaround for the issue you are having. Please go to the options page and click the Test button, it will show the sign-in link. That sign-in link should work.

You can also extract the zip file from GitHub. Then go to about:debugging. Click on "This Firefox". Then click "Load Unpacked Extension" and select the manifest.json file in the extracted folder.

SmartLayer commented 3 years ago

The workaround worked, but can you copy this into readme?

You can also extract the zip file from GitHub. Then go to about:debugging. Click on "This Firefox". Then click "Load Unpacked Extension" and select the manifest.json file in the extracted folder.

I'd do that too if you accept PR

ken107 commented 3 years ago

Sure, please do PR. Btw 1.38 has just been approved.