Skip to content

armgit / cra

Public Imported from GitHub
0

The open-source Arc replacement for macOS. Spaces, pinned tabs, split view, Little Windows and Arc's shortcuts on Chromium, with your Arc sidebar imported in one go.

Ship Cra's own Chromium engine: H.264/AAC video, Web Store installs

Victor5d10ea59f48c
diff --git a/Sources/CraCEF/CraCEF.mm b/Sources/CraCEF/CraCEF.mm
index 6e2218d..fbade3e 100644
--- a/Sources/CraCEF/CraCEF.mm
+++ b/Sources/CraCEF/CraCEF.mm
@@ -130,6 +130,12 @@ public:
if (!g_strayPageHandler || !frame->IsMain()) return false;
NSString* url = NSStringFromCef(request->GetURL());
if (url.length == 0 || [url isEqualToString:@"about:blank"]) return false;
+ // Chrome's own empty tab (the window it opens to show "extension added" after a
+ // Web Store install): nobody asked for it, so it is closed, not turned into a tab.
+ if ([url hasPrefix:@"chrome://newtab"] || [url hasPrefix:@"chrome://new-tab-page"]) {
+ browser->GetHost()->CloseBrowser(true);
+ return true;
+ }
void (^handler)(NSString*) = g_strayPageHandler;
dispatch_async(dispatch_get_main_queue(), ^{ handler(url); });
browser->GetHost()->CloseBrowser(true);
diff --git a/docs/arc-reverse-engineering.md b/docs/arc-reverse-engineering.md
index 5da38e2..cc56e0e 100644
--- a/docs/arc-reverse-engineering.md
+++ b/docs/arc-reverse-engineering.md
@@ -575,8 +575,8 @@ Chromium only enters PiP from a page holding a user activation. `CefBrowserHost:
never reached the page in Chrome-style hosting (CEF 154), so Cra sends an F19 key down/up straight
to Chromium's `RenderWidgetHostViewCocoa` (the view AppKit gives real key presses to); the page sees
`keydown F19` with `navigator.userActivation.isActive = true`, and the injected script requests PiP
-once activation is reported. Test videos must be open codecs (VP9/Opus WebM): the CEF build has no
-H.264/AAC, so an MP4 never loads metadata.
+once activation is reported. (Until 26 Oct test videos had to be VP9/Opus WebM: Spotify's CEF build
+has no H.264/AAC. Cra now ships its own CEF build with them; see docs/release.md.)
### Hover, toolbar colour, library glyph (24 Oct, late evening)
diff --git a/scripts/build-cef.sh b/scripts/build-cef.sh
index 8321596..b1a0838 100755
--- a/scripts/build-cef.sh
+++ b/scripts/build-cef.sh
@@ -56,8 +56,6 @@ automate() {
--with-pgo-profiles \
--no-debug-build \
--minimal-distrib-only \
- --no-distrib-docs \
- --no-distrib-symbols \
"$@"
}
@@ -73,5 +71,10 @@ for p in "$PATCHES"/*.patch; do
git -C chromium/src apply --check --reverse "$p" || { echo "$(basename "$p") does not apply" >&2; exit 1; }
fi
done
-# 3. Build and package without touching the checkout again.
-automate --no-update --force-build --force-distrib
+# 3. Build without touching the checkout again.
+automate --no-update --force-build --no-distrib
+# 4. Package. automate-git does not pass --no-symbols on for branches after 7151,
+# and without dSYMs (enable_dsyms=false) make_distrib then fails.
+rm -rf chromium/src/cef/binary_distrib
+(cd chromium/src/cef/tools && python3 make_distrib.py --output-dir=../binary_distrib --allow-partial \
+ --ninja-build --arm64-build --minimal --no-docs --no-symbols)
diff --git a/scripts/fetch-cef.sh b/scripts/fetch-cef.sh
index f3e1555..6395675 100755
--- a/scripts/fetch-cef.sh
+++ b/scripts/fetch-cef.sh
@@ -14,9 +14,7 @@ ARCH="${CEF_ARCH:-macosarm64}"
NAME="cef_binary_${CEF_VERSION}_${ARCH}_minimal"
# Bump the suffix (codecs2, …) when the build changes but CEF_VERSION does not.
CEF_RELEASE="${CEF_RELEASE:-cef-${CEF_VERSION%%+*}-codecs1}"
-# TODO(codecs): switch to the GitHub build once scripts/publish-cef.sh has run:
-# https://github.com/VictorKildahl/cra/releases/download/${CEF_RELEASE}/cef_binary_${ARCH}_minimal.tar.bz2
-URL="${CEF_URL:-https://cef-builds.spotifycdn.com/${NAME}.tar.bz2}"
+URL="${CEF_URL:-https://github.com/VictorKildahl/cra/releases/download/${CEF_RELEASE}/cef_binary_${ARCH}_minimal.tar.bz2}"
mkdir -p vendor
# A different pinned build replaces vendor/cef.