Skip to content

Commit bf868fe

Browse files
authored
Merge pull request #56 from clear-code/replace-chrome-version-with-thinbridge-extension
Replace implementation of Chrome extension with ThinBridge extension
2 parents 06e7096 + c5aaf48 commit bf868fe

File tree

8 files changed

+680
-30
lines changed

8 files changed

+680
-30
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,3 @@ extlib/*.js
66

77
node_modules
88
package-lock.json
9-
chrome

Makefile

+11-23
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,40 @@
1-
.PHONY: prepare xpi chrome chrome-dev host managed install_dependency lint format install_hook
1+
.PHONY: xpi-prepare xpi chrome host managed install_dependency lint format install_hook
22
TIMESTAMP=$(shell date +%Y%m%d)
33

44
NPM_MOD_DIR := $(CURDIR)/node_modules
55
NPM_BIN_DIR := $(NPM_MOD_DIR)/.bin
66

7-
prepare:
7+
xpi-prepare:
88
git submodule update --init
99
cp submodules/webextensions-lib-configs/Configs.js extlib/; echo 'export default Configs;' >> extlib/Configs.js
1010
cp submodules/webextensions-lib-options/Options.js extlib/; echo 'export default Options;' >> extlib/Options.js
1111
cp submodules/webextensions-lib-l10n/l10n.js extlib/; echo 'export default l10n;' >> extlib/l10n.js
1212

13-
xpi: prepare
13+
xpi: xpi-prepare
1414
rm -f ieview-we.xpi
1515
zip -r -9 ieview-we.xpi manifest.json *.js _locales common options misc/128x128.png extlib -x '*/.*' -x extlib/browser-polyfill.min.js
1616

17-
chrome: prepare
17+
chrome:
1818
[ -d node_modules ] || npm install
19-
rm -rf chrome ieview-we-${TIMESTAMP}.zip
20-
mkdir -p chrome/misc
21-
cat manifest.json | jq 'del(.applications)' | jq '.storage.managed_schema = "managed_schema.json"' > chrome/manifest.json
22-
cp -r managed_schema.json _locales background common options extlib chrome/
23-
cp -r misc/128x128.png chrome/misc
24-
find chrome -name '.*' | xargs rm -rf
25-
#cp node_modules/webextension-polyfill/dist/browser-polyfill.min.js chrome/extlib/
26-
sed -i -E -e 's;("scripts": *\[);\1"extlib/browser-polyfill.min.js",;' chrome/manifest.json
27-
#sed -i -E -e 's;<!--\s*(script.+extlib/browser-polyfill.+)\s*-->;<\1>;' chrome/options/options.html
28-
sed -i -E -e 's;\bbrowser\.;chrome.;g' -e 's;window.messenger;false;g' chrome/*/*.js
29-
cd chrome && zip -r ../ieview-we-${TIMESTAMP}.zip .
30-
31-
chrome-dev: chrome
32-
rm -rf ieview-we-dev-${TIMESTAMP}.zip
33-
sed -i -E -e 's/IE View WE/IE View WE Developer Edition/g' chrome/_locales/*/messages.json
34-
cd chrome && zip -r ../ieview-we-dev-${TIMESTAMP}.zip .
19+
rm -rf ieview-we-chrome-${TIMESTAMP}.zip
20+
cd chrome && make
21+
cp chrome/ieview-we-chrome.zip ./ieview-we-chrome-${TIMESTAMP}.zip
3522

3623
# knldjmfmopnpolahpmmgbagdohdnhkik
3724
DUMMY_KEY="MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDcBHwzDvyBQ6bDppkIs9MP4ksKqCMyXQ/A52JivHZKh4YO/9vJsT3oaYhSpDCE9RPocOEQvwsHsFReW2nUEc6OLLyoCFFxIb7KkLGsmfakkut/fFdNJYh0xOTbSN8YvLWcqph09XAY2Y/f0AL7vfO1cuCqtkMt8hFrBGWxDdf9CQIDAQAB"
3825

39-
chrome-test: chrome
26+
chrome-test:
4027
cat chrome/manifest.json | jq '.key = ${DUMMY_KEY}' > chrome/manifest.json.tmp
4128
mv chrome/manifest.json.tmp chrome/manifest.json
42-
cd chrome && zip -r ../ieview-we-test-${TIMESTAMP}.zip .
29+
cd chrome && make dev
30+
cp chrome/ieview-we-chrome-dev.zip ./ieview-we-chrome-dev-${TIMESTAMP}.zip
4331

4432
host:
4533
host/build.sh
4634
rm -f ieview-we-host.zip
4735
cd host && zip -r -9 ../ieview-we-host.zip 386 amd64 *.bat *.json
4836

49-
managed: prepare
37+
managed: xpi-prepare
5038
rm -f ieview-we-managed-storage.zip
5139
cd managed-storage && zip -r -9 ../ieview-we-managed-storage.zip *.bat *.json
5240

README.md

100755100644
+17-6
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,33 @@ Provides ability to open pages and links by Internet Explorer (Cloned IE View ba
44

55
This works only on Windows.
66

7+
# for Google Chrome (IE View WE MV3)
8+
9+
This was initially started as a cloned IE View based on WebExtensions API, but finally dropped support of original IE View compatible features including the options page.
10+
Only ThinBridge compatible implementation is left on the browser extension part, thus you need to install [ThinBridge](https://github.com/ThinBridge/ThinBridge/) as the native messaging host.
11+
See [ThinBridge](https://github.com/ThinBridge/ThinBridge/) for more details.
12+
13+
IE View WE MV3 msut be loaded via GPO.
14+
See [the document describing how to install development version of the extension via GPO, in the TinBridge project](https://github.com/ThinBridge/ThinBridge/blob/master/DEVELOPMENT.md#how-to-try-extensions-for-development).
15+
16+
# for Firefox (IE View WE MV2)
17+
718
*IMPORTANT NOTE: The list of URLs which should be opened by IE is not compatible to the legacy version's one.*
819
You need to rewrite them based on the [matching pattern spec for Firefox addons](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Match_patterns).
920
For example: `http://example.com` => `http://example.com/*` (note that the added wild card to match any page under the domain.)
1021

11-
# Steps to install
22+
## Steps to install
1223

1324
1. Download the MSI suitable for your environment's architecture, or a zip package "ieview-we-host.zip" from the [releases page](https://github.com/clear-code/ieview-we/releases/latest).
1425
2. If you've downloaded an MSI, run it to install. Otherwise, unzip the downloaded file and double-click the batch file named "install.bat".
1526
3. [Install "IE View WE" Firefox addon from its xpi package.](https://addons.mozilla.org/firefox/addon/ie-view-we/)
1627

17-
# Steps to uninstall
28+
## Steps to uninstall
1829

1930
1. Uninstall "IE View WE" Firefox addon via the addon manager.
2031
2. Double-click the batch file named `uninstall.bat`.
2132

22-
# How to customize Options
33+
## How to customize Options
2334

2435
There are some options which you can customize default behavior:
2536
You can also customize preset configuration via MCD.
@@ -28,7 +39,7 @@ You can also customize preset configuration via MCD.
2839
* `extensions.ieview.ieargs` Command Line Arguments (default: empty)
2940
* `extensions.ieview.contextMenu` Add "Open by IE" items to the context menu (default: true)
3041

31-
## Rules to open by ...
42+
### Rules to open by ...
3243

3344
* `extensions.ieview.forceielist` Websites to be opened by IE always (default: empty)
3445
* `extensions.ieview.disableForce` Disable websites opened by IE always (dfault: false)
@@ -37,14 +48,14 @@ You can also customize preset configuration via MCD.
3748
* `extensions.ieview.onlyMainFrame` Only check URL which is shown in location bar (default: true)
3849
* `extensions.ieview.ignoreQueryString` Ignore query string in URL (default: false)
3950

40-
## Logging & Debugging
51+
### Logging & Debugging
4152

4253
* `extensions.ieview.debug` Print Debug log (default: false)
4354
* `extensions.ieview.logging` Save log (default: true)
4455
* `extensions.ieview.logRotationTime` Rotate log file by specified hour (default: 24)
4556
* `extensions.ieview.logRotationCount` Max count of log files (default: 12)
4657

47-
## How to build the native messaging host and its installer
58+
### How to build the native messaging host and its installer
4859

4960
On Windows 10 + WSL:
5061

chrome/.eslintrc.js

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*
2+
# This Source Code Form is subject to the terms of the Mozilla Public
3+
# License, v. 2.0. If a copy of the MPL was not distributed with this
4+
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
5+
*/
6+
/*eslint-env commonjs*/
7+
/*eslint quote-props: ['error', "always"] */
8+
9+
'use strict';
10+
11+
module.exports = {
12+
'extends': [
13+
'../tools/eslint/for-module.js',
14+
],
15+
};

chrome/.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.zip
2+
dev/
3+

chrome/Makefile

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.PHONY: clean zip
2+
3+
FILES = manifest.json \
4+
background.js
5+
6+
all: zip
7+
8+
clean:
9+
rm -f *.zip
10+
11+
zip: $(FILES)
12+
zip -9 - $(FILES) > ieview-we-chrome.zip

0 commit comments

Comments
 (0)