-
-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
GitHub Actions Bot
committed
Jul 10, 2024
1 parent
3ddf009
commit bd3884c
Showing
69 changed files
with
115,540 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/** | ||
* backgroundscript.js: Background script for the WebExtension Manifest V2 | ||
* | ||
* Copyright 2017 Mossroy and contributors | ||
* Licence GPL v3: | ||
* | ||
* This file is part of Kiwix. | ||
* | ||
* Kiwix is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public Licence as published by | ||
* the Free Software Foundation, either version 3 of the Licence, or | ||
* (at your option) any later version. | ||
* | ||
* Kiwix is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public Licence for more details. | ||
* | ||
* You should have received a copy of the GNU General Public Licence | ||
* along with Kiwix (file LICENSE-GPLv3.txt). If not, see <http://www.gnu.org/licenses/> | ||
*/ | ||
|
||
/* global chrome, browser */ | ||
|
||
// In order to work on both Firefox and Chromium/Chrome (and derivatives). | ||
// browser and chrome variables expose almost the same APIs | ||
var genericBrowser; | ||
if (typeof browser !== 'undefined') { | ||
// Firefox | ||
genericBrowser = browser; | ||
} else { | ||
// Chromium/Chrome | ||
genericBrowser = chrome; | ||
} | ||
// DEV: For a Mozilla MV3 extension, we have to use 'action' instead of 'browserAction' | ||
var genericAction = genericBrowser.browserAction || genericBrowser.action; | ||
genericAction.onClicked.addListener(function () { | ||
var newURL = genericBrowser.runtime.getURL('www/index.html'); | ||
genericBrowser.tabs.create({ url: newURL }); | ||
}); |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!doctype html> | ||
<html> | ||
|
||
<head> | ||
<meta http-equiv="refresh" content="0; url=www/index.html"> | ||
<title>Redirection to index.html</title> | ||
</head> | ||
|
||
<body> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ | ||
"manifest_version": 3, | ||
"name": "Kiwix", | ||
"version": "4.0.1", | ||
|
||
"description": "Kiwix is an offline reader for content from Wikipedia, TED Talks, Stackexchange, and many other sources.", | ||
|
||
"icons": { | ||
"16": "www/img/icons/kiwix-16.png", | ||
"19": "www/img/icons/kiwix-19.png", | ||
"32": "www/img/icons/kiwix-32.png", | ||
"38": "www/img/icons/kiwix-38.png", | ||
"48": "www/img/icons/kiwix-48.png", | ||
"64": "www/img/icons/kiwix-64.png", | ||
"90": "www/img/icons/kiwix-90.png", | ||
"128": "www/img/icons/kiwix-128.png" | ||
}, | ||
|
||
"action": { | ||
"default_icon": { | ||
"16": "www/img/icons/kiwix-16.png", | ||
"19": "www/img/icons/kiwix-19.png", | ||
"32": "www/img/icons/kiwix-32.png", | ||
"38": "www/img/icons/kiwix-38.png", | ||
"64": "www/img/icons/kiwix-64.png" | ||
}, | ||
"default_title": "Kiwix" | ||
}, | ||
|
||
"background": { | ||
"scripts": ["backgroundscript.js"] | ||
}, | ||
|
||
"content_security_policy": { | ||
"extension_pages": "script-src 'self' 'wasm-unsafe-eval'; object-src 'self';", | ||
"sandbox": "sandbox allow-scripts allow-downloads allow-forms allow-popups allow-modals; script-src 'self' 'unsafe-inline' 'unsafe-eval'; child-src 'self';" | ||
}, | ||
|
||
"web_accessible_resources": [{ | ||
"resources": ["www/index.html", "www/article.html"], | ||
"matches": ["https://*.kiwix.org/*", "https://kiwix.github.io/*"] | ||
}], | ||
|
||
"author": "Kiwix", | ||
"homepage_url": "https://www.kiwix.org", | ||
"offline_enabled": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{ | ||
"manifest_version": 3, | ||
"name": "Kiwix JS Browser Extension", | ||
"short_name": "Kiwix JS", | ||
"version": "4.0.1", | ||
|
||
"description": "Kiwix is an offline reader for content from Wikipedia, TED Talks, Stackexchange, and many other sources.", | ||
|
||
"icons": { | ||
"16": "www/img/icons/kiwix-16.png", | ||
"19": "www/img/icons/kiwix-19.png", | ||
"32": "www/img/icons/kiwix-32.png", | ||
"38": "www/img/icons/kiwix-38.png", | ||
"48": "www/img/icons/kiwix-48.png", | ||
"64": "www/img/icons/kiwix-64.png", | ||
"90": "www/img/icons/kiwix-90.png", | ||
"128": "www/img/icons/kiwix-128.png" | ||
}, | ||
|
||
"action": { | ||
"default_icon": { | ||
"16": "www/img/icons/kiwix-16.png", | ||
"19": "www/img/icons/kiwix-19.png", | ||
"32": "www/img/icons/kiwix-32.png", | ||
"38": "www/img/icons/kiwix-38.png", | ||
"64": "www/img/icons/kiwix-64.png" | ||
}, | ||
"default_title": "Kiwix" | ||
}, | ||
|
||
"background": { | ||
"service_worker": "service-worker.js" | ||
}, | ||
|
||
"content_security_policy": { | ||
"extension_pages": "script-src 'self' 'wasm-unsafe-eval'; object-src 'self';", | ||
"sandbox": "sandbox allow-scripts allow-downloads allow-forms allow-popups allow-modals; script-src 'self' 'unsafe-inline' 'unsafe-eval'; child-src 'self';" | ||
}, | ||
|
||
"web_accessible_resources": [{ | ||
"resources": ["www/index.html", "www/article.html"], | ||
"matches": ["https://*.kiwix.org/*", "https://kiwix.github.io/*"] | ||
}], | ||
|
||
"author": "Kiwix", | ||
"homepage_url": "https://www.kiwix.org", | ||
"offline_enabled": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ | ||
"manifest_version": 2, | ||
"name": "Kiwix", | ||
"version": "4.0.1", | ||
|
||
"description": "Kiwix is an offline reader for content from Wikipedia, TED Talks, Stackexchange, and many other sources.", | ||
|
||
"icons": { | ||
"16": "www/img/icons/kiwix-16.png", | ||
"19": "www/img/icons/kiwix-19.png", | ||
"32": "www/img/icons/kiwix-32.png", | ||
"38": "www/img/icons/kiwix-38.png", | ||
"48": "www/img/icons/kiwix-48.png", | ||
"64": "www/img/icons/kiwix-64.png", | ||
"90": "www/img/icons/kiwix-90.png", | ||
"128": "www/img/icons/kiwix-128.png" | ||
}, | ||
|
||
"browser_action": { | ||
"default_icon": { | ||
"16": "www/img/icons/kiwix-16.png", | ||
"19": "www/img/icons/kiwix-19.png", | ||
"32": "www/img/icons/kiwix-32.png", | ||
"38": "www/img/icons/kiwix-38.png", | ||
"64": "www/img/icons/kiwix-64.png" | ||
}, | ||
"default_title": "Kiwix" | ||
}, | ||
|
||
"applications": { | ||
"gecko": { | ||
"id": "[email protected]" | ||
} | ||
}, | ||
|
||
"web_accessible_resources": ["www/index.html"], | ||
|
||
"background": { | ||
"scripts": ["backgroundscript.js"] | ||
}, | ||
|
||
"content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'", | ||
|
||
"author": "mossroy", | ||
"homepage_url": "https://www.kiwix.org", | ||
"offline_enabled": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"version": "4.0.1", | ||
"name": "Kiwix", | ||
"description": "Offline Wikipedia Viewer, and more", | ||
"launch_path": "/www/index.html", | ||
"icons": { | ||
"16": "/www/img/icons/kiwix-16.png", | ||
"32": "/www/img/icons/kiwix-32.png", | ||
"48": "/www/img/icons/kiwix-48.png", | ||
"60": "/www/img/icons/kiwix-60.png", | ||
"90": "/www/img/icons/kiwix-90.png", | ||
"120": "/www/img/icons/kiwix-120.png", | ||
"128": "/www/img/icons/kiwix-128.png", | ||
"256": "/www/img/icons/kiwix-256.png" | ||
}, | ||
"developer": { | ||
"name": "Mossroy <[email protected]>, Peter-x and other Kiwix contributors", | ||
"url": "https://github.com/kiwix" | ||
}, | ||
"default_locale": "en", | ||
"permissions": { | ||
"device-storage:sdcard": { | ||
"description": "Required to read Wikipedia archives", | ||
"access": "readonly" | ||
}, | ||
"geolocation": { | ||
"description": "Necessary only for the 'articles nearby' feature" | ||
} | ||
}, | ||
"type": "privileged", | ||
"origin": "app://kiwix.org" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"name": "Kiwix JS Browser Extension", | ||
"short_name": "Kiwix JS", | ||
"categories": ["reference", "books", "education"], | ||
"start_url": ".", | ||
"description": "Kiwix is an offline reader for content from Wikipedia, Project Gutenberg, TED Talks, Wikivoyage, Stackexchange, and many other Web archives. It makes knowledge available to people with limited or no Internet access.", | ||
"lang": "en-GB", | ||
"background_color": "#000", | ||
"icons": [ | ||
{ | ||
"src": "www/img/icons/kiwix-32.png", | ||
"sizes": "32x32", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "www/img/icons/kiwix-60.png", | ||
"sizes": "60x60", | ||
"type": "image/ico" | ||
}, | ||
{ | ||
"src": "www/img/icons/kiwix-256.png", | ||
"sizes": "256x256", | ||
"type": "image/png" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
{ | ||
"name": "kiwix-js", | ||
"productName": "Kiwix JS", | ||
"version": "4.0.1", | ||
"description": "Kiwix is an offline reader for content from Wikipedia, TED Talks, Stackexchange, and many other sources.", | ||
"type": "module", | ||
"scripts": { | ||
"serve": "vite", | ||
"preview": "del-cli dist && npm run build-src && vite preview", | ||
"prebuild": "del-cli dist", | ||
"build": "rollup --config --file dist/www/js/bundle.js && rollup --config --file dist/www/js/bundle.min.js --environment BUILD:production", | ||
"prebuild-min": "del-cli dist", | ||
"build-min": "rollup --config --file dist/www/js/bundle.min.js --environment BUILD:production", | ||
"prebuild-src": "del-cli dist", | ||
"build-src": "rollup --config --file dist/www/js/bundle.js", | ||
"del-dist": "del-cli dist", | ||
"test": "testcafe all ./tests/unit/initTestCafe.js --app \"http-server --silent -p 8080 .\"", | ||
"test-unit-browsers": "testcafe firefox:headless,chrome:headless,edge:headless ./tests/unit/initTestCafe.js --app \"http-server --silent -p 8080 .\"", | ||
"test-unit-firefox": "testcafe firefox:headless ./tests/unit/initTestCafe.js --app \"http-server --silent -p 8080 .\"", | ||
"test-unit-chrome": "testcafe chrome:headless ./tests/unit/initTestCafe.js --app \"http-server --silent -p 8080 .\"", | ||
"test-unit-edge": "testcafe edge:headless ./tests/unit/initTestCafe.js --app \"http-server --silent -p 8080 .\"", | ||
"test-unit-mac": "testcafe safari ./tests/unit/initTestCafe.js --app \"http-server --silent -p 8080 .\"", | ||
"web-server": "http-server -p 8080 .", | ||
"test-e2e": "npm run test-e2e-firefox && npm run test-e2e-chrome && npm run test-e2e-edge && npm run test-e2e-iemode", | ||
"test-e2e-firefox": "npx start-server-and-test 'http-server --silent' 8080 'npx mocha ./tests/e2e/runners/firefox/firefox.e2e.runner.js'", | ||
"test-e2e-chrome": "npx start-server-and-test 'http-server --silent' 8080 'npx mocha ./tests/e2e/runners/chrome/chromium.e2e.runner.js'", | ||
"test-e2e-edge": "npx start-server-and-test 'http-server --silent' 8080 'npx mocha ./tests/e2e/runners/edge/microsoftEdge.e2e.runner.js'", | ||
"test-e2e-iemode": "npx start-server-and-test 'http-server --silent' 8080 'npx mocha ./tests/e2e/runners/edge/ieMode.e2e.runner.js'" | ||
}, | ||
"engines": { | ||
"node": ">=10" | ||
}, | ||
"dependencies": { | ||
"@fortawesome/fontawesome-free": "5.9.0", | ||
"@types/fs-extra": "^9.0.11", | ||
"bootstrap": "^4.6.2", | ||
"core-js": "3.30.2", | ||
"jquery": "^3.7.0" | ||
}, | ||
"devDependencies": { | ||
"@babel/cli": "^7.21.5", | ||
"@babel/core": "^7.21.5", | ||
"@babel/preset-env": "^7.21.5", | ||
"@rollup/plugin-babel": "^6.0.4", | ||
"@rollup/plugin-commonjs": "^25.0.7", | ||
"@rollup/plugin-node-resolve": "^15.2.3", | ||
"@rollup/plugin-replace": "^5.0.5", | ||
"@rollup/plugin-terser": "^0.4.4", | ||
"@vitejs/plugin-legacy": "^4.0.3", | ||
"babel-plugin-polyfill-corejs3": "^0.7.1", | ||
"del-cli": "^5.0.0", | ||
"eslint": "^8.42.0", | ||
"eslint-config-standard": "^17.1.0", | ||
"eslint-plugin-import": "^2.27.5", | ||
"eslint-plugin-n": "^16.0.0", | ||
"eslint-plugin-promise": "^6.1.1", | ||
"http-server": "^14.1.1", | ||
"mocha": "^10.2.0", | ||
"qunit": "^2.19.4", | ||
"rollup": "^4.5.0", | ||
"rollup-plugin-copy": "^3.4.0", | ||
"selenium-webdriver": "^4.11.1", | ||
"start-server-and-test": "^2.0.0", | ||
"testcafe": "^3.0.0", | ||
"vite": "^4.5.3" | ||
} | ||
} |
Oops, something went wrong.