-
Notifications
You must be signed in to change notification settings - Fork 526
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dev tools 更新,chromium 或者 firefox 启动多实例 (#189)
* update firefox.sh * update firefox.sh * update chromium * update chromium * update firefox * update download-firefox.sh * 解决macos 上 firefox 启动多实例 * update download-firefox.sh * 启动自定义chromium 或者 firefox 添加操作系统检测架构检测 * firefox 使用两种方式启动多实例
- Loading branch information
1 parent
bf89feb
commit 4921bc3
Showing
5 changed files
with
166 additions
and
3,312 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
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
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,91 @@ | ||
#!/bin/bash | ||
|
||
set -exu | ||
|
||
__DIR__=$( | ||
cd "$(dirname "$0")" | ||
pwd | ||
) | ||
cd ${__DIR__} | ||
|
||
__PROJECT__=$( | ||
cd ${__DIR__}/../ | ||
pwd | ||
) | ||
|
||
OS=$(uname -s) | ||
ARCH=$(uname -m) | ||
echo "$OS" | ||
|
||
FIREFOX='' | ||
UUID='' | ||
case $OS in | ||
"Linux") | ||
UUID=$(cat /proc/sys/kernel/random/uuid) | ||
FIREFOX=${__PROJECT__}/var/firefox/firefox | ||
;; | ||
"Darwin") | ||
UUID=$(uuidgen) | ||
# macos firefox 默认启动目录 | ||
FIREFOX='/Applications/Firefox.app/Contents/MacOS/firefox' | ||
# 自定义 启动目录 | ||
FIREFOX="${__PROJECT__}/var/Firefox/Firefox.app/Contents/MacOS/firefox-bin" | ||
;; | ||
'MINGW64_NT'* | 'MSYS_NT'*) | ||
;; | ||
*) | ||
echo 'current script no support !' | ||
;; | ||
esac | ||
|
||
|
||
profile_folder="/tmp/${UUID}" | ||
|
||
mkdir -p $profile_folder | ||
|
||
|
||
mkdir -p ${__PROJECT__}/var/ | ||
cd ${__PROJECT__}/var/ | ||
|
||
|
||
# python3 ${__PROJECT__}/extension/tools/update-manifest.py firefox | ||
|
||
# firefox web extension | ||
# https://github.com/mdn/webextensions-examples.git | ||
|
||
# https://wiki.mozilla.org/Firefox/CommandLineOptions | ||
|
||
# firefox use Manifest V3 | ||
# https://extensionworkshop.com/documentation/develop/manifest-v3-migration-guide/ | ||
|
||
# declarativeNetRequestWithHostAccess 声明式网络请求 | ||
# https://github.com/mdn/webextensions-examples/blob/main/dnr-dynamic-with-options/manifest.json | ||
# "permissions": ["declarativeNetRequestWithHostAccess"], | ||
# "optional_host_permissions": ["*://*/"], | ||
# "optional_permissions": ["*://*/"], | ||
|
||
# 支持 ResourceType | ||
# https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/declarativeNetRequest/ResourceType | ||
|
||
|
||
# 它使用 user.js 中的相应设置覆盖 prefs.js 中的任何设置。 | ||
cp -f ${__PROJECT__}/tools/prefs.js $profile_folder | ||
|
||
# 进入扩展所在目录 | ||
cd ${__PROJECT__}/extension-v2/ | ||
|
||
# reference https://extensionworkshop.com/documentation/develop/web-ext-command-reference/#web-ext-run | ||
|
||
npx web-ext run \ | ||
--verbose \ | ||
--firefox=${FIREFOX} \ | ||
--firefox-profile=$profile_folder \ | ||
--profile-create-if-missing \ | ||
--arg="--new-tab=https://stackoverflow.com/tags/socat/hot?filter=all" \ | ||
--start-url https://m3.material.io/ | ||
|
||
# --devtools \ | ||
# --browser-console \ | ||
|
||
|
||
exit 0 |
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
Oops, something went wrong.