sparkbun 0.1.4 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-linux-arm64/libNativeWrapper.so +0 -0
- package/dist-linux-arm64/{libElectrobunCore.so → libSparkBunCore.so} +0 -0
- package/dist-linux-x64/libNativeWrapper.so +0 -0
- package/dist-linux-x64/{libElectrobunCore.so → libSparkBunCore.so} +0 -0
- package/dist-macos-arm64/libNativeWrapper.dylib +0 -0
- package/dist-macos-arm64/libSparkBunCore.dylib +0 -0
- package/dist-macos-x64/libNativeWrapper.dylib +0 -0
- package/dist-macos-x64/libSparkBunCore.dylib +0 -0
- package/dist-macos-x64/libasar.dylib +0 -0
- package/dist-macos-x64/libwebgpu_dawn.dylib +0 -0
- package/dist-macos-x64/process_helper +0 -0
- package/dist-win-arm64/SparkBunCore.dll +0 -0
- package/dist-win-arm64/WebView2Loader.dll +0 -0
- package/dist-win-arm64/libNativeWrapper.dll +0 -0
- package/dist-win-arm64/zig-asar/arm64/libasar.dll +0 -0
- package/dist-win-arm64/zig-asar/x64/libasar.dll +0 -0
- package/dist-win-x64/SparkBunCore.dll +0 -0
- package/package.json +1 -1
- package/scripts/setup-win-arm64.ps1 +19 -0
- package/src/browser/global.d.ts +11 -11
- package/src/browser/index.ts +10 -10
- package/src/bun/core/BrowserView.ts +2 -2
- package/src/bun/core/Updater.ts +6 -56
- package/src/bun/preload/.generated/compiled.ts +2 -2
- package/src/bun/preload/dragRegions.ts +2 -2
- package/src/bun/preload/encryption.ts +4 -4
- package/src/bun/preload/events.ts +4 -4
- package/src/bun/preload/globals.d.ts +14 -14
- package/src/bun/preload/index-sandboxed.ts +3 -3
- package/src/bun/preload/index.ts +19 -19
- package/src/bun/preload/internalRpc.ts +3 -3
- package/src/bun/preload/webviewTag.ts +2 -2
- package/src/bun/preload/wgpuTag.ts +1 -1
- package/src/bun/proc/native.ts +6 -6
- package/src/cli/index.ts +47 -83
- package/src/core/build.zig +1 -1
- package/src/core/main.zig +25 -24
- package/src/installer/installer-template.ts +1 -1
- package/src/launcher/main.ts +10 -10
- package/src/native/linux/cef_process_helper_linux.cpp +4 -4
- package/src/native/linux/nativeWrapper.cpp +230 -230
- package/src/native/macos/cef_process_helper_mac.cc +4 -4
- package/src/native/macos/nativeWrapper.mm +100 -100
- package/src/native/shared/accelerator_parser.h +5 -5
- package/src/native/shared/app_paths.h +7 -7
- package/src/native/shared/asar.h +5 -5
- package/src/native/shared/cache_migration.h +14 -14
- package/src/native/shared/callbacks.h +5 -5
- package/src/native/shared/cef_response_filter.h +18 -18
- package/src/native/shared/chromium_flags.h +6 -6
- package/src/native/shared/config.h +5 -5
- package/src/native/shared/download_event.h +5 -5
- package/src/native/shared/ffi_helpers.h +6 -6
- package/src/native/shared/glob_match.h +5 -5
- package/src/native/shared/json_menu_parser.h +5 -5
- package/src/native/shared/mime_types.h +5 -5
- package/src/native/shared/navigation_rules.h +5 -5
- package/src/native/shared/partition_context.h +5 -5
- package/src/native/shared/permissions.h +5 -5
- package/src/native/shared/permissions_cef.h +5 -5
- package/src/native/shared/preload_script.h +5 -5
- package/src/native/shared/shutdown_guard.h +5 -5
- package/src/native/shared/thread_safe_map.h +5 -5
- package/src/native/shared/webview_storage.h +5 -5
- package/src/native/win/cef_process_helper_win.cpp +4 -4
- package/src/native/win/dcomp_compositor.h +1 -1
- package/src/native/win/nativeWrapper.cpp +288 -288
- package/src/shared/bsdiff.ts +236 -0
- package/src/shared/bspatch.ts +98 -0
- package/dist-linux-arm64/bsdiff +0 -0
- package/dist-linux-arm64/bspatch +0 -0
- package/dist-linux-x64/bsdiff +0 -0
- package/dist-linux-x64/bspatch +0 -0
- package/dist-macos-arm64/bsdiff +0 -0
- package/dist-macos-arm64/bspatch +0 -0
- package/dist-macos-arm64/libElectrobunCore.dylib +0 -0
- package/dist-macos-arm64/preload-full.js +0 -885
- package/dist-macos-arm64/preload-sandboxed.js +0 -111
- package/dist-win-x64/ElectrobunCore.dll +0 -0
- package/dist-win-x64/bsdiff.exe +0 -0
- package/dist-win-x64/bspatch.exe +0 -0
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
(function(){// src/bun/preload/events.ts
|
|
2
|
-
function emitWebviewEvent(eventName, detail) {
|
|
3
|
-
setTimeout(() => {
|
|
4
|
-
const bridge = window.__electrobunEventBridge || window.__electrobunInternalBridge;
|
|
5
|
-
bridge?.postMessage(JSON.stringify({
|
|
6
|
-
id: "webviewEvent",
|
|
7
|
-
type: "message",
|
|
8
|
-
payload: {
|
|
9
|
-
id: window.__electrobunWebviewId,
|
|
10
|
-
eventName,
|
|
11
|
-
detail
|
|
12
|
-
}
|
|
13
|
-
}));
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
function initLifecycleEvents() {
|
|
17
|
-
window.addEventListener("load", () => {
|
|
18
|
-
if (window === window.top) {
|
|
19
|
-
emitWebviewEvent("dom-ready", document.location.href);
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
window.addEventListener("popstate", () => {
|
|
23
|
-
emitWebviewEvent("did-navigate-in-page", window.location.href);
|
|
24
|
-
});
|
|
25
|
-
window.addEventListener("hashchange", () => {
|
|
26
|
-
emitWebviewEvent("did-navigate-in-page", window.location.href);
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
var cmdKeyHeld = false;
|
|
30
|
-
var cmdKeyTimestamp = 0;
|
|
31
|
-
var CMD_KEY_THRESHOLD_MS = 500;
|
|
32
|
-
function isCmdHeld() {
|
|
33
|
-
if (cmdKeyHeld)
|
|
34
|
-
return true;
|
|
35
|
-
return Date.now() - cmdKeyTimestamp < CMD_KEY_THRESHOLD_MS && cmdKeyTimestamp > 0;
|
|
36
|
-
}
|
|
37
|
-
function initCmdClickHandling() {
|
|
38
|
-
window.addEventListener("keydown", (event) => {
|
|
39
|
-
if (event.key === "Meta" || event.metaKey) {
|
|
40
|
-
cmdKeyHeld = true;
|
|
41
|
-
cmdKeyTimestamp = Date.now();
|
|
42
|
-
}
|
|
43
|
-
}, true);
|
|
44
|
-
window.addEventListener("keyup", (event) => {
|
|
45
|
-
if (event.key === "Meta") {
|
|
46
|
-
cmdKeyHeld = false;
|
|
47
|
-
cmdKeyTimestamp = Date.now();
|
|
48
|
-
}
|
|
49
|
-
}, true);
|
|
50
|
-
window.addEventListener("blur", () => {
|
|
51
|
-
cmdKeyHeld = false;
|
|
52
|
-
});
|
|
53
|
-
window.addEventListener("click", (event) => {
|
|
54
|
-
if (event.metaKey || event.ctrlKey) {
|
|
55
|
-
const anchor = event.target?.closest?.("a");
|
|
56
|
-
if (anchor && anchor.href) {
|
|
57
|
-
event.preventDefault();
|
|
58
|
-
event.stopPropagation();
|
|
59
|
-
event.stopImmediatePropagation();
|
|
60
|
-
emitWebviewEvent("new-window-open", JSON.stringify({
|
|
61
|
-
url: anchor.href,
|
|
62
|
-
isCmdClick: true,
|
|
63
|
-
isSPANavigation: false
|
|
64
|
-
}));
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}, true);
|
|
68
|
-
}
|
|
69
|
-
function initSPANavigationInterception() {
|
|
70
|
-
const originalPushState = history.pushState;
|
|
71
|
-
const originalReplaceState = history.replaceState;
|
|
72
|
-
history.pushState = function(state, title, url) {
|
|
73
|
-
if (isCmdHeld() && url) {
|
|
74
|
-
const resolvedUrl = new URL(String(url), window.location.href).href;
|
|
75
|
-
emitWebviewEvent("new-window-open", JSON.stringify({
|
|
76
|
-
url: resolvedUrl,
|
|
77
|
-
isCmdClick: true,
|
|
78
|
-
isSPANavigation: true
|
|
79
|
-
}));
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
return originalPushState.apply(this, [state, title, url]);
|
|
83
|
-
};
|
|
84
|
-
history.replaceState = function(state, title, url) {
|
|
85
|
-
if (isCmdHeld() && url) {
|
|
86
|
-
const resolvedUrl = new URL(String(url), window.location.href).href;
|
|
87
|
-
emitWebviewEvent("new-window-open", JSON.stringify({
|
|
88
|
-
url: resolvedUrl,
|
|
89
|
-
isCmdClick: true,
|
|
90
|
-
isSPANavigation: true
|
|
91
|
-
}));
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
return originalReplaceState.apply(this, [state, title, url]);
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
function initOverscrollPrevention() {
|
|
98
|
-
document.addEventListener("DOMContentLoaded", () => {
|
|
99
|
-
const style = document.createElement("style");
|
|
100
|
-
style.type = "text/css";
|
|
101
|
-
style.appendChild(document.createTextNode("html, body { overscroll-behavior: none; }"));
|
|
102
|
-
document.head.appendChild(style);
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
// src/bun/preload/index-sandboxed.ts
|
|
107
|
-
initLifecycleEvents();
|
|
108
|
-
initCmdClickHandling();
|
|
109
|
-
initSPANavigationInterception();
|
|
110
|
-
initOverscrollPrevention();
|
|
111
|
-
})();
|
|
Binary file
|
package/dist-win-x64/bsdiff.exe
DELETED
|
Binary file
|
package/dist-win-x64/bspatch.exe
DELETED
|
Binary file
|