Giter Site home page Giter Site logo

anurag607 / kiwix-js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kiwix/kiwix-js

0.0 0.0 0.0 42.79 MB

Fully portable & lightweight ZIM reader in Javascript

Home Page: https://www.kiwix.org/

License: GNU General Public License v3.0

Shell 1.14% JavaScript 59.01% C 35.27% PowerShell 0.66% CSS 0.57% HTML 3.36%

kiwix-js's Introduction

Kiwix JS

Kiwix is an offline viewer for Wikipedia, Stackexchange, Project Gutenberg, and other Web resources packaged as highly compressed ZIM archives. For full information about the open-source Kiwix project, see our main Web site: https://www.kiwix.org/.

Kiwix JS is an official HTML5/Javascript implementation of the Kiwix software, principally targeting browser extensions or add-ons. You can get the extension, completely free, from the Mozilla, Chrome and Edge extension stores (search for "Kiwix", or click on a badge below). There is also a version implemented as an offline-first Progressive Web App (PWA) at https://moz-extension.kiwix.org/current/, primarily intended for use within the Mozilla Extension.

Once you have obtained an archive (see below), select it in Kiwix JS, or drag-and-drop it into the app, and start searching for article titles. No further Internet access is required to read the archive's content. For example, you can have the entire content of Wikipedia in your own language inside your device (including images and audiovisual content) entirely offline. If your Internet access is expensive, intermittent, slow, unreliable, controlled or censored, you can still have offline access to this amazing repository of knowledge, information and culture.

The reader also works with other content in the OpenZIM format, but our main targets are Mediawiki-based content (Wikipedia, Wikivoyage, Wikitionary, etc.), StackExchange, Project Gutenberg and TED Talks.

Build Status: Continuous Integration Build Status: Release CodeFactor Kiwix for Firefox Kiwix for Chrome Kiwix for Edge License: GPL v3

Usage

Install "Kiwix JS" from your browser's add-on store. This is the best way to get the extension, because it will be kept up to date automatically. If you would rather not use a store, you can get a file-based version of the extension from http://download.kiwix.org/release/browsers/, but you will have to update this manually. Alternatively, you can bookmark or install the PWA version from https://moz-extension.kiwix.org/current/ (it will auto-update). To install the PWA in Chromium browsers, go to Settings -> Apps -> Install this site as an app.

Additionally, the app requires ZIM archives that you can download from https://download.kiwix.org/zim/ or https://wiki.kiwix.org/wiki/Content_in_all_languages. You have to download these separately, store them in your filesystem, and manually select them after starting the application (or you can drag-and-drop one into the app).

Some technical details

Technically, after reading an article from a ZIM file, it is necessary to "inject" the dependencies (images, css, etc). For compatibility reasons, there are two main ways of doing this:

  • "ServiceWorker" mode (the default) uses a Service Worker to catch any HTTP request the page may send and reply with content read from the ZIM file. It is a generic and clean way of serving content to the browser. It works in any recent browser, but not in older ones. Service Workers are currently disabled by Mozilla in Firefox extensions, but we use a workaround (an offline-first PWA version) as a substitute within the extension;
  • "JQuery" mode (deprecated) parses the DOM to find the HTML tags of the dependencies and modifies them to point to content we extract from the ZIM. This mode is compatible with any browser, but it cannot run JavaScript inside the ZIM file, so some ZIMs with dynamic content do not work well (if at all). However, Mediawiki-based content (e.g. Wikipedia) works fine in this mode.

You can switch between these content injection modes in Configuration, but if your browser supports ServiceWorker mode, you are strongly advised to remain in this mode.

Compatibility

Since the app is written in HTML/JavaScript, it should work in most recent browser engines and many older ones too, depending on the Content Injection mode supported by the specific browser engine.

Officially supported platforms

Deprecated platforms

These platforms/browsers are deprecated. We still partially test against them, and we'll try to keep compatibility as long as it's not too complicated:

  • Firefox OS >=1.2 (needs to be installed manually on the device with WebIDE)
  • Microsoft Edge Legacy >=40 (needs to run a local copy of the source code)
  • Microsoft Internet Explorer 11 (needs to run a local copy of the source code)

Limitations

It is unfortunately not yet technically possible to "remember" the selected ZIM file and open it automatically (browsers do not allow that for security reasons). A handy alternative is to drag-and-drop a ZIM file into the app, which is a quick way to open an archive and switch between several archives in a folder. There are versions of this app that use frameworks like Electron, UWP or NWJS which do have the capability of remembering the chosen archive between app launches. For desktop Chromium browsers, the File System Access API (see #656) is implemented in a PWA version at https://pwa.kiwix.org.

The app has fast title search, and slower full-text search for ZIM archives that have a full-text index, thanks to the openzim/javascript-libzim project. Currently, full-text searching only works in browsers that support Atomic Operations, which means recent desktop versions of Chromium and Firefox.

Licence

This application is released under the GPL v3 licence. See http://www.gnu.org/licenses/ or the included LICENSE-GPLv3.txt file The source code can be found at https://github.com/kiwix/kiwix-js.

Contributing

Kiwix JS is an open-source project. We encourage individuals with experience of HTML and JavaScript development to contribute to the documentation and code in this repository.

To report a bug, read our REPORT_BUG guide.

For code contributions, read our CONTRIBUTING guide.

To get to know the Kiwix project better, please familiarize yourself with the content on https://www.kiwix.org. There is also a Kiwix Slack group which you can join.

We also have a CODE_OF_CONDUCT : everybody is expected to follow it.

Public releases and nightly builds

The browser extensions are distributed through the stores of each vendor (see links above). But the packages are also saved in https://download.kiwix.org/release/browsers/ if necessary.

Some nightly builds are generated, and should only be used for testing purpose: https://download.kiwix.org/nightly/.

There is a test implementation of the latest code at https://kiwix.github.io/kiwix-js/, but this is used for development, and may be buggy, experimental or unstable.

Previous versions

The first versions of this application were originally part of the Evopedia project: http://www.evopedia.info (discontinued). There was an "articles nearby" feature, that was able to find articles around your location. It has been deleted from the source code with everything related to Evopedia (but still in git history in versions<=2.0.0).

These first versions were targeting Firefox OS (discontinued too: we're not lucky ;-) ).

See CHANGELOG.md for details of previous versions.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.