Drop western default apps from the CN default set
Basecamp, Discord, HEY, Google Contacts/Maps/Messages/Photos, WhatsApp, and X lose their shipped launchers, webapp keybindings, and the whatsapp-slim extension; aether, libreoffice-fresh, and obs-studio leave the base package set. The HEY mailto handler and its registration go with them. Preinstall add/remove lists, the launcher hide list, and chromium flags stay in sync. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QKxGW1raAWaqeU8WdHsMsp
This commit is contained in:
@@ -1,32 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/base-test.sh"
|
||||
|
||||
require_command node
|
||||
|
||||
# A keyless unpacked extension gets a path-derived id, so its settings — and
|
||||
# any shortcut registrations it may grow — would go stale if its load path or
|
||||
# packaging ever changed. The pinned key keeps the id stable everywhere.
|
||||
whatsapp_slim_id=$(node - <<'JS' "$ROOT/default/chromium/extensions/whatsapp-slim/manifest.json"
|
||||
const crypto = require('crypto')
|
||||
const fs = require('fs')
|
||||
|
||||
const manifest = JSON.parse(fs.readFileSync(process.argv[2], 'utf8'))
|
||||
const hash = crypto.createHash('sha256').update(Buffer.from(manifest.key, 'base64')).digest()
|
||||
const alphabet = 'abcdefghijklmnop'
|
||||
let id = ''
|
||||
|
||||
for (const byte of hash.subarray(0, 16)) {
|
||||
id += alphabet[byte >> 4]
|
||||
id += alphabet[byte & 0x0f]
|
||||
}
|
||||
|
||||
process.stdout.write(id)
|
||||
JS
|
||||
)
|
||||
|
||||
[[ $whatsapp_slim_id == "amhpgjbcfakkmkeojmoaoiochhifohdi" ]] ||
|
||||
fail "whatsapp-slim extension manifest has the stable id" "$whatsapp_slim_id"
|
||||
pass "whatsapp-slim extension manifest has the stable id"
|
||||
@@ -1,30 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/base-test.sh"
|
||||
|
||||
require_command jq
|
||||
require_command node
|
||||
|
||||
EXT_DIR="$ROOT/default/chromium/extensions/whatsapp-slim"
|
||||
|
||||
jq -e '
|
||||
.content_scripts[0].js == ["system-theme.js"] and
|
||||
.content_scripts[0].run_at == "document_start"
|
||||
' "$EXT_DIR/manifest.json" >/dev/null || fail "WhatsApp enables system theming before startup"
|
||||
|
||||
mode=$(node - "$EXT_DIR/system-theme.js" <<'JS'
|
||||
const fs = require("fs")
|
||||
const values = new Map()
|
||||
let reloaded = false
|
||||
global.localStorage = {
|
||||
getItem: key => values.get(key),
|
||||
setItem: (key, value) => values.set(key, value),
|
||||
}
|
||||
global.location = { reload: () => { reloaded = true } }
|
||||
eval(fs.readFileSync(process.argv[2], "utf8"))
|
||||
process.stdout.write(`${values.get("system-theme-mode")}:${reloaded}`)
|
||||
JS
|
||||
)
|
||||
|
||||
[[ $mode == "true:true" ]] || fail "WhatsApp selects its system theme mode" "$mode"
|
||||
pass "WhatsApp follows the system theme through its existing slim extension"
|
||||
Reference in New Issue
Block a user