├── LICENSE ├── README.md └── webcomic_reader.user.js /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Javier Lopez, Andreas Källberg 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Webcomic Reader 2 | 3 | [![Join the chat at https://gitter.im/webcomic_reader/Lobby](https://badges.gitter.im/webcomic_reader/Lobby.svg)](https://gitter.im/webcomic_reader/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 4 | 5 | This is my fork of Amiboide's Webcomic Reader userscript originally hosted at [userscripts.org](http://userscripts-mirror.org/scripts/show/59842) (R.I.P.), currently also hosted at [openuserjs.org](https://openuserjs.org/scripts/anka-213/Webcomic_Reader) and [greasyfork.org](https://sleazyfork.org/en/scripts/15096-webcomic-reader) 6 | 7 | Script for reading webcomics easier, nicer and faster. Tested on: Firefox, Chrome+Tampermonkey/NinjaKit, Safari+NinjaKit, Opera 8 | 9 | It can show the page as usual adding only a couple buttons and text under the image (default setting), or only the image and back/next buttons, the title text of the image (if any) and optionally some custom extra content (by toggling the layout). 10 | Lets you navigate using the back/next buttons, left/right arrow keys, or clicking the image itself (on the right half to go forward, on the left to go backwards). 11 | Preloads up to 5 (or more) pages ahead (in either direction, in case you want to start from the end...) 12 | 13 | Able to remember the current page so that the next time you visit the site you can go back to where you left without having to add a bookmark, or save more than one page for whatever reason you want (maybe for saving your progress on more than one manga on the same site) 14 | 15 | When using a download accelerator (like [DownThemAll](https://addons.mozilla.org/en-US/firefox/addon/downthemall/)) you can download all the fetched images by downloading all links with the text starting with "wcrimg" (just enter "wcrimg" as the filter in DownThemAll, other programs/extension may have similar options) 16 | 17 | ### Installing 18 | 19 | 1. Install a userscript manager: [Greasemonkey](https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/) for Firefox, [Tampermonkey](https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo) for Google Chrome and [Tampermonkey](https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo) or [NinjaKit](https://github.com/os0x/NinjaKit) for Safari. 20 | 2. Click [here](https://github.com/anka-213/webcomic_reader/raw/master/webcomic_reader.user.js) to install this script. 21 | 22 | 23 | #### Keyboard shortcuts 24 | 25 | They can be customized in the settings screen. 26 | 27 | The deafult keys are: 28 | 29 | * Left/right arrows to move to the previous/next page 30 | * Ctrl+arrows to scroll 31 | * F5 or "." to reload the current page (warning: reloading by any other mean, like using the browser's reload button, will take you back to the page where you started reading) 32 | * "-" to toggle between the original and minimalistic layout 33 | * Shift+"-" to toggle between showing or hiding the script's buttons (back/next, bookmarks, settings, etc...) 34 | * "+" to toggle the fit-to-screen option (zooms in or out the image to make it fit in the window) 35 | * Ctrl+Alt+A to add the current page to the site's bookmarks 36 | * Ctrl+Alt+B to set the current page as the only bookmark (so on your next visit you can be auto-redirected there) 37 | * Ctrl+Alt+S to start/stop slideshow (ESC also stops it, as well as manually turning a page) 38 | * Ctrl+Alt+X to toggle the "debug mode" (to get alerts on errors, useful for testing settings for new sites) 39 | * "," while in "debug mode" to see the currently preloaded links/images 40 | 41 | #### Other browsers 42 | 43 | This script was made for Firefox and uses some Greasemonkey-specific functions for some things, which aren't supported by other browsers. Luckily there are extensions that act as a Greasemonkey replacement and implement most of them. 44 | #### Google Chrome / Safari 45 | 46 | I strongly suggest you use Tampermonkey (Chrome only) or NinjaKit, which support most Greasemonkey functions. 47 | In Chrome, it can also be installed directly without external extensions, but it will have the same limitations mentioned for Opera. 48 | 49 | #### Opera 50 | 51 | Can run without a Greasemonkey-like extension, but without the Greasemonkey-specific functionality. Because of the lack of a proper way to emulate GM_xmlhttpRequest and GM_setValue/GM_getValue: 52 | 53 | * Cross-site requests can't be done, so the auto-updater doesn't work 54 | * Settings are stored separately for each site (with localStorage), which means default settings won't be reflected across different sites (that includes custom keyboard shrotcuts, default layout options, shared site settings for pages with different hostnames). If you want to change the default settings across all sites, the only way would be to edit them directly in the script's source code 55 | 56 | #### Android phones 57 | 58 | There's a version of Tampermonkey for Android, but I haven't tested it, though reports seem to indicate the script doesn't work correctly yet :( 59 | 60 | #### iPhone, iPad, and other browsers 61 | 62 | If the browser you use doesn't support userscripts, you can use a bookmarklet to load it instead. Just copy the following code and add it as a bookmark, and when you want to use the script, go to the site you want to read and load that bookmark. 63 | ```javascript 64 | javascript: (function(){ document.body.appendChild(document.createElement("script")).src = "https://gitcdn.link/repo/anka-213/webcomic_reader/master/webcomic_reader.user.js"; })(); 65 | ``` 66 | Notice that this will download the script everytime you want to use it, so it will take more time to start. Also, the same drawbacks mentioned for Opera will apply. Avoid this technique if you can use a proper Greasemonkeysh extension. 67 | For step by step instructions on how to do this on an iPad, read [this topic](http://userscripts-mirror.org/topics/70361). I have only tested this on an iPad, iPhone and the major PC browsers and it works as expected, except on Internet Explorer (which you shouldn't be using anyway) 68 | Thanks to [krunkster](http://userscripts-mirror.org/users/308335) for this trick ;) 69 | 70 | #### Internet Explorer 71 | 72 | To get this script and the rest of the web working correctly, use IE for what it's best at: downloading Firefox, Chrome, or another real browser. 73 | 74 | #### Adding new sites 75 | 76 | It works out-of-the-box with over 400 sites (full list below), but adding new ones is fairly easy in most cases. 77 | A detailed guide can be found here, but the TL;DR version goes something like this: 78 | 79 | 1. Add an @include rule for the page (use * as a wildcard for the @included url, like "http://www.example.com/*") (\*) 80 | 2. Try it, it may already work with the default settings. If it does, you're done :) 81 | 3. If it doesn't work / works wrong / you want to specify some more settings, right click the Greasemonkey icon (or left click the NinjaKit/Tampermonkey icon) and go to "User Script Commands..."/"Webcomic Reader - Settings" 82 | 4. Click on "Site Settings" on the top of the screen, and there there's a lot of stuff you can change with xpath, css selectors, regular expressions, functions, etc 83 | 84 | (\*) To add @include rules you must open the script source code. On Greasemonkey right click the monkey icon and go to "Manage User Scripts", then find this script, right click it and choose "Edit". On Chrome with NinjaKit/Tampermonkey, right click the extension's icon and click "Options", then select this script to edit it. In modern versions of the extensions, there is also a gui for adding include rules without modifying the source. 85 | 86 | Once you have opened the code, scroll a few lines down until you find a lot of lines that look like this: "// @include http://www.example.com/*". Then just add another one with the exact same format and write your url there. 87 | 88 | Note that after an update or reinstallation, the source code will be rewritten and any changes you made to the code will be lost, so be sure to back them up before updating. The settings themselves (from step 4) will be kept safe. 89 | 90 | In general, it's possible to add any site that consists of a main image and links to the previous and next pages. If you have trouble adding a new site you can ask for help here, or if you succeeded you can post your settings and I can add them to the script :) You can get your custom settings for a site by opening the console (F12), and looking for the text "Using custom settings". 91 | --------------------------------------------------------------------------------