Skip to content

Commit

Permalink
Merge pull request #56 from clear-code/replace-chrome-version-with-th…
Browse files Browse the repository at this point in the history
…inbridge-extension

Replace implementation of Chrome extension with ThinBridge extension
  • Loading branch information
piroor authored Sep 25, 2024
2 parents 06e7096 + c5aaf48 commit bf868fe
Show file tree
Hide file tree
Showing 8 changed files with 680 additions and 30 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ extlib/*.js

node_modules
package-lock.json
chrome
34 changes: 11 additions & 23 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,52 +1,40 @@
.PHONY: prepare xpi chrome chrome-dev host managed install_dependency lint format install_hook
.PHONY: xpi-prepare xpi chrome host managed install_dependency lint format install_hook
TIMESTAMP=$(shell date +%Y%m%d)

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

prepare:
xpi-prepare:
git submodule update --init
cp submodules/webextensions-lib-configs/Configs.js extlib/; echo 'export default Configs;' >> extlib/Configs.js
cp submodules/webextensions-lib-options/Options.js extlib/; echo 'export default Options;' >> extlib/Options.js
cp submodules/webextensions-lib-l10n/l10n.js extlib/; echo 'export default l10n;' >> extlib/l10n.js

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

chrome: prepare
chrome:
[ -d node_modules ] || npm install
rm -rf chrome ieview-we-${TIMESTAMP}.zip
mkdir -p chrome/misc
cat manifest.json | jq 'del(.applications)' | jq '.storage.managed_schema = "managed_schema.json"' > chrome/manifest.json
cp -r managed_schema.json _locales background common options extlib chrome/
cp -r misc/128x128.png chrome/misc
find chrome -name '.*' | xargs rm -rf
#cp node_modules/webextension-polyfill/dist/browser-polyfill.min.js chrome/extlib/
sed -i -E -e 's;("scripts": *\[);\1"extlib/browser-polyfill.min.js",;' chrome/manifest.json
#sed -i -E -e 's;<!--\s*(script.+extlib/browser-polyfill.+)\s*-->;<\1>;' chrome/options/options.html
sed -i -E -e 's;\bbrowser\.;chrome.;g' -e 's;window.messenger;false;g' chrome/*/*.js
cd chrome && zip -r ../ieview-we-${TIMESTAMP}.zip .

chrome-dev: chrome
rm -rf ieview-we-dev-${TIMESTAMP}.zip
sed -i -E -e 's/IE View WE/IE View WE Developer Edition/g' chrome/_locales/*/messages.json
cd chrome && zip -r ../ieview-we-dev-${TIMESTAMP}.zip .
rm -rf ieview-we-chrome-${TIMESTAMP}.zip
cd chrome && make
cp chrome/ieview-we-chrome.zip ./ieview-we-chrome-${TIMESTAMP}.zip

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

chrome-test: chrome
chrome-test:
cat chrome/manifest.json | jq '.key = ${DUMMY_KEY}' > chrome/manifest.json.tmp
mv chrome/manifest.json.tmp chrome/manifest.json
cd chrome && zip -r ../ieview-we-test-${TIMESTAMP}.zip .
cd chrome && make dev
cp chrome/ieview-we-chrome-dev.zip ./ieview-we-chrome-dev-${TIMESTAMP}.zip

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

managed: prepare
managed: xpi-prepare
rm -f ieview-we-managed-storage.zip
cd managed-storage && zip -r -9 ../ieview-we-managed-storage.zip *.bat *.json

Expand Down
23 changes: 17 additions & 6 deletions README.md
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,33 @@ Provides ability to open pages and links by Internet Explorer (Cloned IE View ba

This works only on Windows.

# for Google Chrome (IE View WE MV3)

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.
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.
See [ThinBridge](https://github.com/ThinBridge/ThinBridge/) for more details.

IE View WE MV3 msut be loaded via GPO.
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).

# for Firefox (IE View WE MV2)

*IMPORTANT NOTE: The list of URLs which should be opened by IE is not compatible to the legacy version's one.*
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).
For example: `http://example.com` => `http://example.com/*` (note that the added wild card to match any page under the domain.)

# Steps to install
## Steps to install

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).
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".
3. [Install "IE View WE" Firefox addon from its xpi package.](https://addons.mozilla.org/firefox/addon/ie-view-we/)

# Steps to uninstall
## Steps to uninstall

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

# How to customize Options
## How to customize Options

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

## Rules to open by ...
### Rules to open by ...

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

## Logging & Debugging
### Logging & Debugging

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

## How to build the native messaging host and its installer
### How to build the native messaging host and its installer

On Windows 10 + WSL:

Expand Down
15 changes: 15 additions & 0 deletions chrome/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/*eslint-env commonjs*/
/*eslint quote-props: ['error', "always"] */

'use strict';

module.exports = {
'extends': [
'../tools/eslint/for-module.js',
],
};
3 changes: 3 additions & 0 deletions chrome/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.zip
dev/

12 changes: 12 additions & 0 deletions chrome/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.PHONY: clean zip

FILES = manifest.json \
background.js

all: zip

clean:
rm -f *.zip

zip: $(FILES)
zip -9 - $(FILES) > ieview-we-chrome.zip
Loading

0 comments on commit bf868fe

Please sign in to comment.