dteviot / WebToEpub

A simple Chrome (and Firefox) Extension that converts Web Novels (and other web pages) into an EPUB.
Other
649 stars 123 forks source link

WebToEpub

(c) 2015 David Teviotdale

Extension for Firefox and Chrome that converts Web Novels (and other web pages) into an EPUB. Works with many sites, including the following:

Credits

How to use with Baka-Tsuki:

How to use with Archive of Our Own:

How to use for site that there is no specific parser for:

See: https://dteviot.github.io/Projects/webToEpub_DefaultParser.html

How to create Parsers for new sites

For details on how to extend, see the following

How to install

from Chrome Web Store

with Firefox

on Android

How to install from Source (for people who are not developers)

Firefox

The easiest set of steps is using Firefox.

  1. Download prebuilt Firefox version of extension from https://drive.google.com/drive/folders/1B_X2WcsaI_eg9yA-5bHJb8VeTZGKExl8?usp=sharing.
  2. Open Firefox and type "about:debugging#/runtime/this-firefox" into the URL bar.
  3. Click "Load Temporary Add-on".
  4. Click on the zip file you downloaded in step 1. Installing in Firefox screenshot

Chrome

  1. Download prebuilt Chrome version of extension from https://drive.google.com/drive/folders/1B_X2WcsaI_eg9yA-5bHJb8VeTZGKExl8?usp=sharing.
  2. Unpack zip file
  3. Open Chrome and type "chrome://extensions" into the browser.
  4. Make sure "Developer Mode" at the top of the page is checked.
  5. Press the "Load unpacked extension.." button and browse to unpacked zip directory from step 2. wte-chrome-small

How to install from Source (for developers)

  1. Clone this repo
  2. Build extension. See "To run Eslint (and build the plugin)" in "Other notes" below.
  3. Install extension in browser of choice, using instructions above.

License information

Licenced under GPLv3.

WebToEpub uses the following libraries:

Other notes

To run Eslint (and build the plugin)

To run unit tests

To run unit tests without Node.js

  • If you are not trying to run unit tests in /unitTest/ folder, you do not need this
  • If you can use nodejs, see previous paragraph instead
  • If you can not install nodejs or http-server is not working when you run npm test, and you have no alternative ways to serve files (like chrome Web Server app for example), you have to allow browser to run local html files to run tests.

    To run unit tests (without local server) under Chrome

  • Close all running copies of Chrome
  • Start Chrome with command line argument --allow-file-access-from-files. That is:
    • Open a command propmt
    • Browse to the directory holding Chrome
    • Type in command chrome.exe --allow-file-access-from-files . Press "Enter".
    • If you don't do this, some tests will fail with error messages containing the text Failed to execute 'send' on 'XMLHttpRequest': Failed to load.
  • Load unitTest/Tests.html
  • If you get Failed to read the 'localStorage' property from 'Window': Access is denied for this document errors
    • Type chrome://settings/content into Chrome's search bar
    • Uncheck Block third-party cookies and site data
    • Click Finished
    • Re-run unit tests
  • When finished with unit tests.
    • Restore original value of Block third-party cookies and site data (if you changed it).
    • close all running copies of Chrome

To run unit tests (without local server) under Firefox

  • Start Firefox
  • Go to about:config
  • Find security.fileuri.strict_origin_policy parameter
  • Set it to false
  • Load unitTest/Tests.html
  • (Remember to reset security.fileuri.strict_origin_policy to true when done.