sparkbun 0.1.5 → 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.
Files changed (79) hide show
  1. package/dist-linux-arm64/libNativeWrapper.so +0 -0
  2. package/dist-linux-arm64/{libElectrobunCore.so → libSparkBunCore.so} +0 -0
  3. package/dist-linux-x64/libNativeWrapper.so +0 -0
  4. package/dist-linux-x64/{libElectrobunCore.so → libSparkBunCore.so} +0 -0
  5. package/dist-macos-arm64/libNativeWrapper.dylib +0 -0
  6. package/dist-macos-arm64/libSparkBunCore.dylib +0 -0
  7. package/dist-macos-x64/libNativeWrapper.dylib +0 -0
  8. package/dist-macos-x64/libSparkBunCore.dylib +0 -0
  9. package/dist-macos-x64/libasar.dylib +0 -0
  10. package/dist-macos-x64/libwebgpu_dawn.dylib +0 -0
  11. package/dist-macos-x64/process_helper +0 -0
  12. package/dist-win-arm64/SparkBunCore.dll +0 -0
  13. package/dist-win-arm64/WebView2Loader.dll +0 -0
  14. package/dist-win-arm64/libNativeWrapper.dll +0 -0
  15. package/dist-win-arm64/zig-asar/arm64/libasar.dll +0 -0
  16. package/dist-win-arm64/zig-asar/x64/libasar.dll +0 -0
  17. package/dist-win-x64/SparkBunCore.dll +0 -0
  18. package/package.json +1 -1
  19. package/scripts/setup-win-arm64.ps1 +19 -0
  20. package/src/browser/global.d.ts +11 -11
  21. package/src/browser/index.ts +10 -10
  22. package/src/bun/core/BrowserView.ts +2 -2
  23. package/src/bun/core/Updater.ts +6 -56
  24. package/src/bun/preload/.generated/compiled.ts +2 -2
  25. package/src/bun/preload/dragRegions.ts +2 -2
  26. package/src/bun/preload/encryption.ts +4 -4
  27. package/src/bun/preload/events.ts +4 -4
  28. package/src/bun/preload/globals.d.ts +14 -14
  29. package/src/bun/preload/index-sandboxed.ts +3 -3
  30. package/src/bun/preload/index.ts +19 -19
  31. package/src/bun/preload/internalRpc.ts +3 -3
  32. package/src/bun/preload/webviewTag.ts +2 -2
  33. package/src/bun/preload/wgpuTag.ts +1 -1
  34. package/src/bun/proc/native.ts +6 -6
  35. package/src/cli/index.ts +17 -49
  36. package/src/core/build.zig +1 -1
  37. package/src/core/main.zig +25 -24
  38. package/src/installer/installer-template.ts +1 -1
  39. package/src/launcher/main.ts +10 -10
  40. package/src/native/linux/cef_process_helper_linux.cpp +4 -4
  41. package/src/native/linux/nativeWrapper.cpp +230 -230
  42. package/src/native/macos/cef_process_helper_mac.cc +4 -4
  43. package/src/native/macos/nativeWrapper.mm +100 -100
  44. package/src/native/shared/accelerator_parser.h +5 -5
  45. package/src/native/shared/app_paths.h +7 -7
  46. package/src/native/shared/asar.h +5 -5
  47. package/src/native/shared/cache_migration.h +14 -14
  48. package/src/native/shared/callbacks.h +5 -5
  49. package/src/native/shared/cef_response_filter.h +18 -18
  50. package/src/native/shared/chromium_flags.h +6 -6
  51. package/src/native/shared/config.h +5 -5
  52. package/src/native/shared/download_event.h +5 -5
  53. package/src/native/shared/ffi_helpers.h +6 -6
  54. package/src/native/shared/glob_match.h +5 -5
  55. package/src/native/shared/json_menu_parser.h +5 -5
  56. package/src/native/shared/mime_types.h +5 -5
  57. package/src/native/shared/navigation_rules.h +5 -5
  58. package/src/native/shared/partition_context.h +5 -5
  59. package/src/native/shared/permissions.h +5 -5
  60. package/src/native/shared/permissions_cef.h +5 -5
  61. package/src/native/shared/preload_script.h +5 -5
  62. package/src/native/shared/shutdown_guard.h +5 -5
  63. package/src/native/shared/thread_safe_map.h +5 -5
  64. package/src/native/shared/webview_storage.h +5 -5
  65. package/src/native/win/cef_process_helper_win.cpp +4 -4
  66. package/src/native/win/dcomp_compositor.h +1 -1
  67. package/src/native/win/nativeWrapper.cpp +288 -288
  68. package/src/shared/bsdiff.ts +236 -0
  69. package/src/shared/bspatch.ts +98 -0
  70. package/dist-linux-arm64/bsdiff +0 -0
  71. package/dist-linux-arm64/bspatch +0 -0
  72. package/dist-linux-x64/bsdiff +0 -0
  73. package/dist-linux-x64/bspatch +0 -0
  74. package/dist-macos-arm64/bsdiff +0 -0
  75. package/dist-macos-arm64/bspatch +0 -0
  76. package/dist-macos-arm64/libElectrobunCore.dylib +0 -0
  77. package/dist-win-x64/ElectrobunCore.dll +0 -0
  78. package/dist-win-x64/bsdiff.exe +0 -0
  79. package/dist-win-x64/bspatch.exe +0 -0
@@ -1,5 +1,5 @@
1
1
  // Internal RPC System for webview tags, drag regions, etc.
2
- // Communicates with Bun via __electrobunInternalBridge
2
+ // Communicates with Bun via __sparkbunInternalBridge
3
3
 
4
4
  import "./globals.d.ts";
5
5
 
@@ -23,7 +23,7 @@ function processQueue() {
23
23
  isProcessingQueue = true;
24
24
  const batch = JSON.stringify(sendQueue);
25
25
  sendQueue.length = 0;
26
- window.__electrobunInternalBridge?.postMessage(batch);
26
+ window.__sparkbunInternalBridge?.postMessage(batch);
27
27
 
28
28
  // 2ms delay to work around Bun JSCallback threading issue
29
29
  setTimeout(() => {
@@ -48,7 +48,7 @@ export function request(type: string, payload: unknown): Promise<unknown> {
48
48
  method: type,
49
49
  id,
50
50
  params: payload,
51
- hostWebviewId: window.__electrobunWebviewId,
51
+ hostWebviewId: window.__sparkbunWebviewId,
52
52
  }),
53
53
  );
54
54
  processQueue();
@@ -126,8 +126,8 @@ export class SparkBunWebviewTag extends HTMLElement {
126
126
 
127
127
  try {
128
128
  const webviewInitParams = {
129
- hostWebviewId: window.__electrobunWebviewId,
130
- windowId: window.__electrobunWindowId,
129
+ hostWebviewId: window.__sparkbunWebviewId,
130
+ windowId: window.__sparkbunWindowId,
131
131
  renderer,
132
132
  url,
133
133
  html,
@@ -63,7 +63,7 @@ export class SparkBunWgpuTag extends HTMLElement {
63
63
 
64
64
  try {
65
65
  const wgpuViewId = (await request("wgpuTagInit", {
66
- windowId: window.__electrobunWindowId,
66
+ windowId: window.__sparkbunWindowId,
67
67
  frame: {
68
68
  width: rect.width,
69
69
  height: rect.height,
@@ -75,7 +75,7 @@ function getWindowPtr(winId: number) {
75
75
  }
76
76
 
77
77
  function getCoreLastError(): string | null {
78
- const error = core?.symbols.electrobun_core_last_error();
78
+ const error = core?.symbols.sparkbun_core_last_error();
79
79
  if (!error) {
80
80
  return null;
81
81
  }
@@ -110,11 +110,11 @@ const core = (() => {
110
110
  const corePath = join(
111
111
  binDir,
112
112
  process.platform === "win32"
113
- ? "ElectrobunCore.dll"
114
- : `libElectrobunCore.${suffix}`,
113
+ ? "SparkBunCore.dll"
114
+ : `libSparkBunCore.${suffix}`,
115
115
  );
116
116
  return dlopen(corePath, {
117
- electrobun_core_last_error: {
117
+ sparkbun_core_last_error: {
118
118
  args: [],
119
119
  returns: FFIType.cstring,
120
120
  },
@@ -620,7 +620,7 @@ const core = (() => {
620
620
  },
621
621
  });
622
622
  } catch (err) {
623
- throw new Error(`Failed to load ElectrobunCore: ${err}`);
623
+ throw new Error(`Failed to load SparkBunCore: ${err}`);
624
624
  }
625
625
  })();
626
626
 
@@ -3066,7 +3066,7 @@ export const internalRpcHandlers = {
3066
3066
  }
3067
3067
  core_.symbols.updatePreloadScriptToWebView(
3068
3068
  params.id,
3069
- toCString("electrobun_custom_preload_script"),
3069
+ toCString("sparkbun_custom_preload_script"),
3070
3070
  toCString(params.preload),
3071
3071
  true,
3072
3072
  );
package/src/cli/index.ts CHANGED
@@ -33,7 +33,6 @@ import {
33
33
  getMacOSBundleDisplayName,
34
34
  } from "../shared/naming";
35
35
  import { getTemplate, getTemplateNames } from "./templates/embedded";
36
- // import { loadBsdiff, loadBspatch } from 'bsdiff-wasm';
37
36
  // MacOS named pipes hang at around 4KB
38
37
  // @ts-expect-error - reserved for future use
39
38
  const _MAX_CHUNK_SIZE = 1024 * 2;
@@ -115,17 +114,15 @@ function getPlatformPaths(
115
114
  BUN_BINARY: join(platformDistDir, "bun") + binExt,
116
115
  LAUNCHER_DEV: join(platformDistDir, "sparkbun") + binExt,
117
116
  LAUNCHER_RELEASE: join(platformDistDir, "launcher") + binExt,
118
- CORE_MACOS: join(platformDistDir, "libElectrobunCore.dylib"),
119
- CORE_WIN: join(platformDistDir, "ElectrobunCore.dll"),
120
- CORE_LINUX: join(platformDistDir, "libElectrobunCore.so"),
117
+ CORE_MACOS: join(platformDistDir, "libSparkBunCore.dylib"),
118
+ CORE_WIN: join(platformDistDir, "SparkBunCore.dll"),
119
+ CORE_LINUX: join(platformDistDir, "libSparkBunCore.so"),
121
120
  NATIVE_WRAPPER_MACOS: join(platformDistDir, "libNativeWrapper.dylib"),
122
121
  NATIVE_WRAPPER_WIN: join(platformDistDir, "libNativeWrapper.dll"),
123
122
  NATIVE_WRAPPER_LINUX: join(platformDistDir, "libNativeWrapper.so"),
124
123
  NATIVE_WRAPPER_LINUX_CEF: join(platformDistDir, "libNativeWrapper_cef.so"),
125
124
  WEBVIEW2LOADER_WIN: join(platformDistDir, "WebView2Loader.dll"),
126
- BSPATCH: join(platformDistDir, "bspatch") + binExt,
127
125
  EXTRACTOR: join(platformDistDir, "extractor") + binExt,
128
- BSDIFF: join(platformDistDir, "bsdiff") + binExt,
129
126
  CEF_FRAMEWORK_MACOS: join(
130
127
  platformDistDir,
131
128
  "cef",
@@ -2138,7 +2135,7 @@ usageDescriptions : ""}${urlTypes ? "\n" + urlTypes : ""}${documentTypes ?
2138
2135
 
2139
2136
  // copy native wrapper dynamic library
2140
2137
  if (targetOS === "macos") {
2141
- cpSync(targetPaths.CORE_MACOS, join(appBundleMacOSPath, "libElectrobunCore.dylib"), {
2138
+ cpSync(targetPaths.CORE_MACOS, join(appBundleMacOSPath, "libSparkBunCore.dylib"), {
2142
2139
  dereference: true,
2143
2140
  });
2144
2141
 
@@ -2151,7 +2148,7 @@ usageDescriptions : ""}${urlTypes ? "\n" + urlTypes : ""}${documentTypes ?
2151
2148
  dereference: true,
2152
2149
  });
2153
2150
  } else if (targetOS === "win") {
2154
- cpSync(targetPaths.CORE_WIN, join(appBundleMacOSPath, "ElectrobunCore.dll"), {
2151
+ cpSync(targetPaths.CORE_WIN, join(appBundleMacOSPath, "SparkBunCore.dll"), {
2155
2152
  dereference: true,
2156
2153
  });
2157
2154
 
@@ -2174,7 +2171,7 @@ usageDescriptions : ""}${urlTypes ? "\n" + urlTypes : ""}${documentTypes ?
2174
2171
  } else if (targetOS === "linux") {
2175
2172
  // Choose the appropriate native wrapper based on bundleCEF setting
2176
2173
  const useCEF = config.build.linux?.bundleCEF;
2177
- cpSync(targetPaths.CORE_LINUX, join(appBundleMacOSPath, "libElectrobunCore.so"), {
2174
+ cpSync(targetPaths.CORE_LINUX, join(appBundleMacOSPath, "libSparkBunCore.so"), {
2178
2175
  dereference: true,
2179
2176
  });
2180
2177
  const nativeWrapperLinuxSource = useCEF
@@ -2551,21 +2548,7 @@ usageDescriptions : ""}${urlTypes ? "\n" + urlTypes : ""}${documentTypes ?
2551
2548
  }
2552
2549
  }
2553
2550
 
2554
- // copy native bindings
2555
- const bsPatchSource = targetPaths.BSPATCH;
2556
- const bsPatchDestination =
2557
- join(appBundleMacOSPath, "bspatch") + targetBinExt;
2558
- const bsPatchDestFolder = dirname(bsPatchDestination);
2559
- if (!existsSync(bsPatchDestFolder)) {
2560
- mkdirSync(bsPatchDestFolder, { recursive: true });
2561
- }
2562
-
2563
- cpSync(bsPatchSource, bsPatchDestination, {
2564
- recursive: true,
2565
- dereference: true,
2566
- });
2567
-
2568
- // libasar is still loaded by ElectrobunCore at runtime — needed until
2551
+ // libasar is still loaded by SparkBunCore at runtime — needed until
2569
2552
  // native wrappers are recompiled without ASAR support
2570
2553
  const libExt = targetOS === "win" ? ".dll" : targetOS === "macos" ? ".dylib" : ".so";
2571
2554
  const asarLibSource = join(dirname(targetPaths.BSPATCH), "libasar" + libExt);
@@ -2941,39 +2924,25 @@ usageDescriptions : ""}${urlTypes ? "\n" + urlTypes : ""}${documentTypes ?
2941
2924
 
2942
2925
  if (canGeneratePatch) {
2943
2926
  console.log("diff previous and new tarballs...");
2944
- // Run it as a separate process to leverage multi-threadedness
2945
- // especially for creating multiple diffs in parallel
2946
- const bsdiffpath = targetPaths.BSDIFF;
2947
2927
  const patchFilePath = join(buildFolder, `${prevHash}.patch`);
2948
- const result = Bun.spawnSync(
2949
- [
2950
- bsdiffpath,
2951
- prevTarballPath,
2952
- tarPath,
2953
- patchFilePath,
2954
- ],
2955
- {
2956
- cwd: buildFolder,
2957
- stdout: "inherit",
2958
- stderr: "inherit",
2959
- },
2960
- );
2961
- if (!result.success) {
2962
- // Patch generation is non-critical - users will just download full updates instead of delta patches
2928
+ try {
2929
+ const { createPatch } = await import("../shared/bsdiff.ts");
2930
+ const oldData = new Uint8Array(await Bun.file(prevTarballPath).arrayBuffer());
2931
+ const newData = new Uint8Array(await Bun.file(tarPath).arrayBuffer());
2932
+ const patch = createPatch(oldData, newData);
2933
+ await Bun.write(patchFilePath, patch);
2934
+ artifactsToUpload.push(patchFilePath);
2935
+ } catch (error) {
2963
2936
  console.error("\n" + "=".repeat(80));
2964
2937
  console.error(
2965
- "WARNING: Patch generation failed (exit code " +
2966
- result.exitCode +
2967
- ")",
2938
+ "WARNING: Patch generation failed: " +
2939
+ (error as Error).message,
2968
2940
  );
2969
2941
  console.error(
2970
2942
  "Delta updates will not be available for this release.",
2971
2943
  );
2972
2944
  console.error("Users will download the full update instead.");
2973
2945
  console.error("=".repeat(80) + "\n");
2974
- } else {
2975
- // Only add patch to artifacts if it was successfully created
2976
- artifactsToUpload.push(patchFilePath);
2977
2946
  }
2978
2947
 
2979
2948
  // Clean up previous tarball now that bsdiff is done
@@ -4208,7 +4177,6 @@ Description: ${shortDesc}${longDesc}
4208
4177
  // postinst
4209
4178
  writeFileSync(join(controlDir, "postinst"), `#!/bin/sh
4210
4179
  chmod +x ${installDir}/bin/${exeName}
4211
- chmod +x ${installDir}/bin/bspatch 2>/dev/null || true
4212
4180
  gtk-update-icon-cache -f -t /usr/share/icons/hicolor 2>/dev/null || true
4213
4181
  update-desktop-database /usr/share/applications 2>/dev/null || true
4214
4182
  `);
@@ -5,7 +5,7 @@ pub fn build(b: *std.Build) void {
5
5
  const optimize = b.standardOptimizeOption(.{});
6
6
 
7
7
  const lib = b.addSharedLibrary(.{
8
- .name = "ElectrobunCore",
8
+ .name = "SparkBunCore",
9
9
  .root_source_file = b.path("main.zig"),
10
10
  .target = target,
11
11
  .optimize = optimize,
package/src/core/main.zig CHANGED
@@ -185,7 +185,7 @@ fn freeTrayState(state: *TrayState) void {
185
185
  }
186
186
  }
187
187
 
188
- export fn electrobun_core_last_error() [*:0]const u8 {
188
+ export fn sparkbun_core_last_error() [*:0]const u8 {
189
189
  if (last_error) |message| {
190
190
  return message.ptr;
191
191
  }
@@ -216,7 +216,7 @@ fn rememberDefaultWebviewCallbacks(
216
216
  }
217
217
 
218
218
  fn ensureHostMessageWakeupInitialized() bool {
219
- if (builtin.os.tag == .windows) {
219
+ if (comptime builtin.os.tag == .windows) {
220
220
  return false;
221
221
  }
222
222
 
@@ -236,6 +236,7 @@ fn ensureHostMessageWakeupInitialized() bool {
236
236
  }
237
237
 
238
238
  fn signalHostMessageWakeup() void {
239
+ if (comptime builtin.os.tag == .windows) return;
239
240
  if (!ensureHostMessageWakeupInitialized()) {
240
241
  return;
241
242
  }
@@ -837,7 +838,7 @@ fn startHostTransportServer(requested_port: u32) bool {
837
838
  return false;
838
839
  }
839
840
 
840
- fn buildElectrobunPreload(
841
+ fn buildSparkBunPreload(
841
842
  webview_id: u32,
842
843
  window_id: u32,
843
844
  secret_key: [*:0]const u8,
@@ -851,10 +852,10 @@ fn buildElectrobunPreload(
851
852
  const sandboxed_preload_script = webview_runtime_state.preload_script_sandboxed.?;
852
853
  return std.fmt.allocPrintZ(
853
854
  allocator,
854
- \\window.__electrobunWebviewId = {d};
855
- \\window.__electrobunWindowId = {d};
856
- \\window.__electrobunEventBridge = window.__electrobunEventBridge || window.webkit?.messageHandlers?.eventBridge || window.eventBridge || window.chrome?.webview?.hostObjects?.eventBridge;
857
- \\window.__electrobunInternalBridge = window.__electrobunInternalBridge || window.webkit?.messageHandlers?.internalBridge || window.internalBridge || window.chrome?.webview?.hostObjects?.internalBridge;
855
+ \\window.__sparkbunWebviewId = {d};
856
+ \\window.__sparkbunWindowId = {d};
857
+ \\window.__sparkbunEventBridge = window.__sparkbunEventBridge || window.webkit?.messageHandlers?.eventBridge || window.eventBridge || window.chrome?.webview?.hostObjects?.eventBridge;
858
+ \\window.__sparkbunInternalBridge = window.__sparkbunInternalBridge || window.webkit?.messageHandlers?.internalBridge || window.internalBridge || window.chrome?.webview?.hostObjects?.internalBridge;
858
859
  \\{s}
859
860
  ,
860
861
  .{ webview_id, window_id, sandboxed_preload_script },
@@ -867,15 +868,15 @@ fn buildElectrobunPreload(
867
868
  const preload_script = webview_runtime_state.preload_script.?;
868
869
  return std.fmt.allocPrintZ(
869
870
  allocator,
870
- \\window.__electrobunWebviewId = {d};
871
- \\window.__electrobunWindowId = {d};
872
- \\window.__electrobunHostSocketPort = {d};
873
- \\window.__electrobunRpcSocketPort = {d};
874
- \\window.__electrobunSecretKeyBytes = [{s}];
875
- \\window.__electrobunEventBridge = window.__electrobunEventBridge || window.webkit?.messageHandlers?.eventBridge || window.eventBridge || window.chrome?.webview?.hostObjects?.eventBridge;
876
- \\window.__electrobunInternalBridge = window.__electrobunInternalBridge || window.webkit?.messageHandlers?.internalBridge || window.internalBridge || window.chrome?.webview?.hostObjects?.internalBridge;
877
- \\window.__electrobunHostBridge = window.__electrobunHostBridge || window.__electrobunBunBridge || window.webkit?.messageHandlers?.hostBridge || window.webkit?.messageHandlers?.bunBridge || window.hostBridge || window.bunBridge || window.chrome?.webview?.hostObjects?.hostBridge || window.chrome?.webview?.hostObjects?.bunBridge;
878
- \\window.__electrobunBunBridge = window.__electrobunBunBridge || window.webkit?.messageHandlers?.bunBridge || window.bunBridge || window.chrome?.webview?.hostObjects?.bunBridge;
871
+ \\window.__sparkbunWebviewId = {d};
872
+ \\window.__sparkbunWindowId = {d};
873
+ \\window.__sparkbunHostSocketPort = {d};
874
+ \\window.__sparkbunRpcSocketPort = {d};
875
+ \\window.__sparkbunSecretKeyBytes = [{s}];
876
+ \\window.__sparkbunEventBridge = window.__sparkbunEventBridge || window.webkit?.messageHandlers?.eventBridge || window.eventBridge || window.chrome?.webview?.hostObjects?.eventBridge;
877
+ \\window.__sparkbunInternalBridge = window.__sparkbunInternalBridge || window.webkit?.messageHandlers?.internalBridge || window.internalBridge || window.chrome?.webview?.hostObjects?.internalBridge;
878
+ \\window.__sparkbunHostBridge = window.__sparkbunHostBridge || window.__sparkbunBunBridge || window.webkit?.messageHandlers?.hostBridge || window.webkit?.messageHandlers?.bunBridge || window.hostBridge || window.bunBridge || window.chrome?.webview?.hostObjects?.hostBridge || window.chrome?.webview?.hostObjects?.bunBridge;
879
+ \\window.__sparkbunBunBridge = window.__sparkbunBunBridge || window.webkit?.messageHandlers?.bunBridge || window.bunBridge || window.chrome?.webview?.hostObjects?.bunBridge;
879
880
  \\{s}
880
881
  ,
881
882
  .{
@@ -1185,7 +1186,7 @@ fn buildHostWebviewEventJavascript(
1185
1186
  const event_name_slice = std.mem.span(event_name);
1186
1187
  if (std.mem.eql(u8, event_name_slice, "new-window-open") or std.mem.eql(u8, event_name_slice, "host-message")) {
1187
1188
  return allocateOwnedJavascriptString(
1188
- "document.querySelector('#electrobun-webview-{d}').emit({s}, {s});",
1189
+ "document.querySelector('#sparkbun-webview-{d}').emit({s}, {s});",
1189
1190
  .{ webview_id, encoded_event_name, std.mem.span(detail) },
1190
1191
  );
1191
1192
  }
@@ -1194,14 +1195,14 @@ fn buildHostWebviewEventJavascript(
1194
1195
  defer allocator.free(encoded_detail);
1195
1196
 
1196
1197
  return allocateOwnedJavascriptString(
1197
- "document.querySelector('#electrobun-webview-{d}').emit({s}, {s});",
1198
+ "document.querySelector('#sparkbun-webview-{d}').emit({s}, {s});",
1198
1199
  .{ webview_id, encoded_event_name, encoded_detail },
1199
1200
  );
1200
1201
  }
1201
1202
 
1202
1203
  fn buildInternalMessageJavascript(message_json: [*:0]const u8) ?[:0]u8 {
1203
1204
  return allocateOwnedJavascriptString(
1204
- "window.__electrobun.receiveInternalMessageFromHost({s});",
1205
+ "window.__sparkbun.receiveInternalMessageFromHost({s});",
1205
1206
  .{std.mem.span(message_json)},
1206
1207
  );
1207
1208
  }
@@ -1540,7 +1541,7 @@ fn handleInternalMessage(message_id: []const u8, payload: std.json.Value) void {
1540
1541
  const preload = jsonString(payload_object.get("preload") orelse return) orelse return;
1541
1542
  const preload_z = duplicateSentinelString(preload) orelse return;
1542
1543
  defer allocator.free(preload_z);
1543
- updatePreloadScriptToWebView(webview_id, "electrobun_custom_preload_script", preload_z.ptr, true);
1544
+ updatePreloadScriptToWebView(webview_id, "sparkbun_custom_preload_script", preload_z.ptr, true);
1544
1545
  return;
1545
1546
  }
1546
1547
 
@@ -1806,7 +1807,7 @@ fn managedQuitRequestedTrampoline() callconv(.C) void {
1806
1807
  }
1807
1808
  }
1808
1809
 
1809
- export fn electrobun_core_run_main_thread(
1810
+ export fn sparkbun_core_run_main_thread(
1810
1811
  identifier: [*:0]const u8,
1811
1812
  name: [*:0]const u8,
1812
1813
  channel: [*:0]const u8,
@@ -2293,7 +2294,7 @@ export fn createWebview(
2293
2294
  };
2294
2295
  webview_registry_mutex.unlock();
2295
2296
 
2296
- const electrobun_preload_script = buildElectrobunPreload(
2297
+ const sparkbun_preload_script = buildSparkBunPreload(
2297
2298
  webview_id,
2298
2299
  window_id,
2299
2300
  secret_key,
@@ -2304,7 +2305,7 @@ export fn createWebview(
2304
2305
  webview_registry_mutex.unlock();
2305
2306
  return 0;
2306
2307
  };
2307
- defer allocator.free(electrobun_preload_script);
2308
+ defer allocator.free(sparkbun_preload_script);
2308
2309
 
2309
2310
  set_next_webview_flags(start_transparent, start_passthrough);
2310
2311
 
@@ -2324,7 +2325,7 @@ export fn createWebview(
2324
2325
  event_bridge_handler,
2325
2326
  hostBridgeQueueTrampoline,
2326
2327
  internalBridgeCoreTrampoline,
2327
- electrobun_preload_script.ptr,
2328
+ sparkbun_preload_script.ptr,
2328
2329
  custom_preload_script,
2329
2330
  views_root,
2330
2331
  window_state.transparent,
@@ -119,7 +119,7 @@ async function createWindowsShortcuts(appDir: string, meta: Metadata) {
119
119
 
120
120
  function fixPermissions(appDir: string) {
121
121
  const exeBaseName = appDir.split("/").pop()?.replace(/ /g, "") || "app";
122
- const executables = [`bin/${exeBaseName}`, "bin/bspatch", "bin/bsdiff"];
122
+ const executables = [`bin/${exeBaseName}`];
123
123
  for (const exe of executables) {
124
124
  const path = join(appDir, exe);
125
125
  if (existsSync(path)) {
@@ -8,8 +8,8 @@ const pathToMacOS = dirname(process.argv0);
8
8
  process.chdir(pathToMacOS);
9
9
  const coreLibFileName =
10
10
  process.platform === "win32"
11
- ? "ElectrobunCore.dll"
12
- : `libElectrobunCore.${suffix}`;
11
+ ? "SparkBunCore.dll"
12
+ : `libSparkBunCore.${suffix}`;
13
13
  const coreLibPath = join(pathToMacOS, coreLibFileName);
14
14
  const absoluteCoreLibPath = resolve(coreLibPath);
15
15
 
@@ -148,28 +148,28 @@ function main() {
148
148
  try {
149
149
 
150
150
  lib = dlopen(coreLibPath, {
151
- electrobun_core_run_main_thread: {
151
+ sparkbun_core_run_main_thread: {
152
152
  args: ["cstring", "cstring", "cstring", "i32"],
153
153
  returns: "i32",
154
154
  },
155
- electrobun_core_last_error: {
155
+ sparkbun_core_last_error: {
156
156
  args: [],
157
157
  returns: "cstring",
158
158
  },
159
159
  });
160
160
  } catch (error) {
161
161
  console.error(
162
- `[LAUNCHER] Failed to load ElectrobunCore: ${(error as Error).message}`,
162
+ `[LAUNCHER] Failed to load SparkBunCore: ${(error as Error).message}`,
163
163
  );
164
164
 
165
165
  // Try with absolute path as fallback
166
166
  try {
167
167
  lib = dlopen(absoluteCoreLibPath, {
168
- electrobun_core_run_main_thread: {
168
+ sparkbun_core_run_main_thread: {
169
169
  args: ["cstring", "cstring", "cstring", "i32"],
170
170
  returns: "i32",
171
171
  },
172
- electrobun_core_last_error: {
172
+ sparkbun_core_last_error: {
173
173
  args: [],
174
174
  returns: "cstring",
175
175
  },
@@ -201,7 +201,7 @@ function main() {
201
201
  // preload: [''];
202
202
  });
203
203
 
204
- const runStatus = lib.symbols.electrobun_core_run_main_thread(
204
+ const runStatus = lib.symbols.sparkbun_core_run_main_thread(
205
205
  ptr(new Uint8Array(Buffer.from(identifier + "\0", "utf8"))),
206
206
  ptr(new Uint8Array(Buffer.from(name + "\0", "utf8"))),
207
207
  ptr(new Uint8Array(Buffer.from(channel + "\0", "utf8"))),
@@ -209,9 +209,9 @@ function main() {
209
209
  );
210
210
 
211
211
  if (runStatus !== 0) {
212
- const coreError = lib.symbols.electrobun_core_last_error();
212
+ const coreError = lib.symbols.sparkbun_core_last_error();
213
213
  console.error(
214
- `[LAUNCHER] ElectrobunCore failed: ${coreError ? coreError.toString() : "Unknown error"}`,
214
+ `[LAUNCHER] SparkBunCore failed: ${coreError ? coreError.toString() : "Unknown error"}`,
215
215
  );
216
216
  process.exit(runStatus);
217
217
  }
@@ -68,7 +68,7 @@ public:
68
68
  CefRefPtr<CefV8Value> eventBridge = CefV8Value::CreateObject(nullptr, nullptr);
69
69
  CefRefPtr<CefV8Value> eventPostMessage = CreatePostMessageFunction(browser, "EventBridgeMessage");
70
70
  eventBridge->SetValue("postMessage", eventPostMessage, V8_PROPERTY_ATTRIBUTE_NONE);
71
- window->SetValue("__electrobunEventBridge", eventBridge, V8_PROPERTY_ATTRIBUTE_NONE);
71
+ window->SetValue("__sparkbunEventBridge", eventBridge, V8_PROPERTY_ATTRIBUTE_NONE);
72
72
 
73
73
  // Only create hostBridge/bunBridge aliases and internalBridge for non-sandboxed webviews
74
74
  if (!is_sandboxed) {
@@ -76,14 +76,14 @@ public:
76
76
  CefRefPtr<CefV8Value> bunBridge = CefV8Value::CreateObject(nullptr, nullptr);
77
77
  CefRefPtr<CefV8Value> bunPostMessage = CreatePostMessageFunction(browser, "BunBridgeMessage");
78
78
  bunBridge->SetValue("postMessage", bunPostMessage, V8_PROPERTY_ATTRIBUTE_NONE);
79
- window->SetValue("__electrobunHostBridge", bunBridge, V8_PROPERTY_ATTRIBUTE_NONE);
80
- window->SetValue("__electrobunBunBridge", bunBridge, V8_PROPERTY_ATTRIBUTE_NONE);
79
+ window->SetValue("__sparkbunHostBridge", bunBridge, V8_PROPERTY_ATTRIBUTE_NONE);
80
+ window->SetValue("__sparkbunBunBridge", bunBridge, V8_PROPERTY_ATTRIBUTE_NONE);
81
81
 
82
82
  // Create internalBridge - internal RPC bridge
83
83
  CefRefPtr<CefV8Value> internalBridge = CefV8Value::CreateObject(nullptr, nullptr);
84
84
  CefRefPtr<CefV8Value> internalPostMessage = CreatePostMessageFunction(browser, "internalMessage");
85
85
  internalBridge->SetValue("postMessage", internalPostMessage, V8_PROPERTY_ATTRIBUTE_NONE);
86
- window->SetValue("__electrobunInternalBridge", internalBridge, V8_PROPERTY_ATTRIBUTE_NONE);
86
+ window->SetValue("__sparkbunInternalBridge", internalBridge, V8_PROPERTY_ATTRIBUTE_NONE);
87
87
  }
88
88
 
89
89
  v8Context->Exit();