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.
Files changed (81) 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 +47 -83
  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-macos-arm64/preload-full.js +0 -885
  78. package/dist-macos-arm64/preload-sandboxed.js +0 -111
  79. package/dist-win-x64/ElectrobunCore.dll +0 -0
  80. package/dist-win-x64/bsdiff.exe +0 -0
  81. package/dist-win-x64/bspatch.exe +0 -0
@@ -2,14 +2,14 @@
2
2
  // Parses strings like "CommandOrControl+Shift+T" into modifier flags and a key.
3
3
  // Header-only to match the pattern of json_menu_parser.h.
4
4
 
5
- #ifndef ELECTROBUN_ACCELERATOR_PARSER_H
6
- #define ELECTROBUN_ACCELERATOR_PARSER_H
5
+ #ifndef SPARKBUN_ACCELERATOR_PARSER_H
6
+ #define SPARKBUN_ACCELERATOR_PARSER_H
7
7
 
8
8
  #include <string>
9
9
  #include <vector>
10
10
  #include <algorithm>
11
11
 
12
- namespace electrobun {
12
+ namespace sparkbun {
13
13
 
14
14
  struct AcceleratorParts {
15
15
  std::string key; // The key, lowercased (e.g. "t", "f1", "space")
@@ -67,6 +67,6 @@ inline AcceleratorParts parseAccelerator(const std::string& accelerator) {
67
67
  return result;
68
68
  }
69
69
 
70
- } // namespace electrobun
70
+ } // namespace sparkbun
71
71
 
72
- #endif // ELECTROBUN_ACCELERATOR_PARSER_H
72
+ #endif // SPARKBUN_ACCELERATOR_PARSER_H
@@ -1,9 +1,9 @@
1
- #ifndef ELECTROBUN_APP_PATHS_H
2
- #define ELECTROBUN_APP_PATHS_H
1
+ #ifndef SPARKBUN_APP_PATHS_H
2
+ #define SPARKBUN_APP_PATHS_H
3
3
 
4
4
  #include <string>
5
5
 
6
- namespace electrobun {
6
+ namespace sparkbun {
7
7
 
8
8
  /**
9
9
  * Build the app data path using identifier/channel structure.
@@ -11,7 +11,7 @@ namespace electrobun {
11
11
  * the CLI and updater conventions.
12
12
  *
13
13
  * @param basePath The base application support/data path (e.g., ~/Library/Application Support)
14
- * @param identifier The app identifier (e.g., "sh.blackboard.electrobun-kitchen")
14
+ * @param identifier The app identifier (e.g., "sh.sparkbun-kitchen")
15
15
  * @param channel The release channel (e.g., "dev", "canary", "stable")
16
16
  * @param suffix Optional suffix to append (e.g., "CEF", "WebView2")
17
17
  * @param pathSeparator The path separator to use ('/' for Unix, '\\' for Windows)
@@ -24,7 +24,7 @@ inline std::string buildAppDataPath(
24
24
  const std::string& suffix = "",
25
25
  char pathSeparator = '/'
26
26
  ) {
27
- std::string appId = !identifier.empty() ? identifier : "Electrobun";
27
+ std::string appId = !identifier.empty() ? identifier : "SparkBun";
28
28
  std::string channelPath = !channel.empty() ? channel : "default";
29
29
 
30
30
  std::string result = basePath;
@@ -105,6 +105,6 @@ inline std::string buildCEFPartitionPath(
105
105
  return base;
106
106
  }
107
107
 
108
- } // namespace electrobun
108
+ } // namespace sparkbun
109
109
 
110
- #endif // ELECTROBUN_APP_PATHS_H
110
+ #endif // SPARKBUN_APP_PATHS_H
@@ -5,8 +5,8 @@
5
5
  // - libasar library (macOS, Linux)
6
6
  // - Built-in AsarArchive class (Windows)
7
7
 
8
- #ifndef ELECTROBUN_ASAR_H
9
- #define ELECTROBUN_ASAR_H
8
+ #ifndef SPARKBUN_ASAR_H
9
+ #define SPARKBUN_ASAR_H
10
10
 
11
11
  #include <cstdint>
12
12
  #include <cstddef>
@@ -23,13 +23,13 @@ extern "C" {
23
23
  void asar_free_buffer(const uint8_t* buffer, size_t size);
24
24
  }
25
25
 
26
- namespace electrobun {
26
+ namespace sparkbun {
27
27
 
28
28
  // Global ASAR archive handle (lazy-loaded) with thread-safe initialization
29
29
  // Each platform should define these in their nativeWrapper implementation
30
30
  // as: static AsarArchive* g_asarArchive = nullptr;
31
31
  // static std::once_flag g_asarArchiveInitFlag;
32
32
 
33
- } // namespace electrobun
33
+ } // namespace sparkbun
34
34
 
35
- #endif // ELECTROBUN_ASAR_H
35
+ #endif // SPARKBUN_ASAR_H
@@ -1,8 +1,8 @@
1
- // cache_migration.h - One-shot CEF cache folder wipe on Electrobun upgrades.
1
+ // cache_migration.h - One-shot CEF cache folder wipe on SparkBun upgrades.
2
2
  //
3
- // When Electrobun ships a release whose CEF cache folder layout/contents are
3
+ // When SparkBun ships a release whose CEF cache folder layout/contents are
4
4
  // incompatible with prior releases (e.g. a CEF major bump that surfaces
5
- // "Profile error" dialogs, or an Electrobun-side change to partition layout),
5
+ // "Profile error" dialogs, or an SparkBun-side change to partition layout),
6
6
  // the simplest reliable recovery is to wipe the cache folder. End users will
7
7
  // be logged out of sites they were logged into via the app, but the app
8
8
  // starts cleanly with no dialogs.
@@ -12,7 +12,7 @@
12
12
  // always require a wipe.
13
13
  //
14
14
  // Behavior:
15
- // 1. Reads <cacheFolder>/.electrobun_cef_cache_version on startup.
15
+ // 1. Reads <cacheFolder>/.sparkbun_cef_cache_version on startup.
16
16
  // 2. If the sentinel is missing OR its value != CEF_CACHE_FORMAT_VERSION,
17
17
  // deletes everything inside cacheFolder (preserving the folder itself)
18
18
  // and writes a fresh sentinel.
@@ -24,17 +24,17 @@
24
24
  //
25
25
  // Safety guards (any failure → no-op, never wipe):
26
26
  // - empty / null / relative paths
27
- // - paths whose final component isn't a known Electrobun cache name
27
+ // - paths whose final component isn't a known SparkBun cache name
28
28
  // - paths shallower than 3 components below the filesystem root
29
29
  // - any std::filesystem exception
30
30
  //
31
31
  // Callers must invoke this AFTER computing the cache path and BEFORE
32
32
  // CefInitialize is called for that path. Multi-process locking is NOT
33
- // implemented: Electrobun's app process starts before any windows open,
33
+ // implemented: SparkBun's app process starts before any windows open,
34
34
  // so concurrent first-launch races aren't a concern in practice.
35
35
 
36
- #ifndef ELECTROBUN_CACHE_MIGRATION_H
37
- #define ELECTROBUN_CACHE_MIGRATION_H
36
+ #ifndef SPARKBUN_CACHE_MIGRATION_H
37
+ #define SPARKBUN_CACHE_MIGRATION_H
38
38
 
39
39
  #include <cstdint>
40
40
  #include <cstdio>
@@ -44,13 +44,13 @@
44
44
  #include <string>
45
45
  #include <system_error>
46
46
 
47
- namespace electrobun {
47
+ namespace sparkbun {
48
48
 
49
49
  // MANUAL bump only. Increment when a release requires that end users'
50
50
  // existing CEF cache folders be wiped on first launch after upgrade.
51
51
  // Reasons that justify a bump:
52
52
  // - CEF major-version jump that's known to surface profile-error dialogs
53
- // - Electrobun-side change to cache folder layout (e.g. partition path)
53
+ // - SparkBun-side change to cache folder layout (e.g. partition path)
54
54
  // - Any other situation where stale state would degrade the user experience
55
55
  // in a way Chromium's own forward-migration can't handle.
56
56
  // Bumping invalidates cookies/logins/site data for all users on first launch.
@@ -60,7 +60,7 @@ namespace electrobun {
60
60
  constexpr uint32_t CEF_CACHE_FORMAT_VERSION = 2;
61
61
 
62
62
  inline const char* cacheSentinelFilename() {
63
- return ".electrobun_cef_cache_version";
63
+ return ".sparkbun_cef_cache_version";
64
64
  }
65
65
 
66
66
  inline uint32_t readCacheSentinel(const std::filesystem::path& sentinelPath) {
@@ -102,7 +102,7 @@ inline void writeCacheSentinel(const std::filesystem::path& sentinelPath,
102
102
  }
103
103
 
104
104
  // Refuses paths that look unsafe to wipe. Returns true only when the path
105
- // is absolute, ends in a recognized Electrobun cache folder name, and is
105
+ // is absolute, ends in a recognized SparkBun cache folder name, and is
106
106
  // at least 3 components deep below the filesystem root.
107
107
  inline bool isCachePathSafeToWipe(const std::filesystem::path& cachePath) {
108
108
  if (cachePath.empty()) return false;
@@ -239,6 +239,6 @@ inline void migrateCacheFolderIfNeeded(const std::string& cacheFolderPath) {
239
239
  }
240
240
  }
241
241
 
242
- } // namespace electrobun
242
+ } // namespace sparkbun
243
243
 
244
- #endif // ELECTROBUN_CACHE_MIGRATION_H
244
+ #endif // SPARKBUN_CACHE_MIGRATION_H
@@ -3,12 +3,12 @@
3
3
  //
4
4
  // This is a header-only implementation to avoid build complexity.
5
5
 
6
- #ifndef ELECTROBUN_CALLBACKS_H
7
- #define ELECTROBUN_CALLBACKS_H
6
+ #ifndef SPARKBUN_CALLBACKS_H
7
+ #define SPARKBUN_CALLBACKS_H
8
8
 
9
9
  #include <cstdint>
10
10
 
11
- namespace electrobun {
11
+ namespace sparkbun {
12
12
 
13
13
  // Webview navigation and event callbacks
14
14
  // NOTE: Bun's FFIType.true doesn't play well with Objective-C's YES/NO char booleans
@@ -52,6 +52,6 @@ typedef void (*QuitRequestedHandler)();
52
52
  typedef const char* (*GetMimeType)(const char* filePath);
53
53
  typedef const char* (*GetHTMLForWebviewSync)(uint32_t webviewId);
54
54
 
55
- } // namespace electrobun
55
+ } // namespace sparkbun
56
56
 
57
- #endif // ELECTROBUN_CALLBACKS_H
57
+ #endif // SPARKBUN_CALLBACKS_H
@@ -5,44 +5,44 @@
5
5
  // This is a header-only implementation to avoid build complexity.
6
6
  // Requires CEF headers to be included before this file.
7
7
 
8
- #ifndef ELECTROBUN_CEF_RESPONSE_FILTER_H
9
- #define ELECTROBUN_CEF_RESPONSE_FILTER_H
8
+ #ifndef SPARKBUN_CEF_RESPONSE_FILTER_H
9
+ #define SPARKBUN_CEF_RESPONSE_FILTER_H
10
10
 
11
11
  #include <string>
12
12
  #include <algorithm>
13
13
  #include <cstring>
14
14
  #include "preload_script.h"
15
15
 
16
- namespace electrobun {
16
+ namespace sparkbun {
17
17
 
18
18
  // CEF Response Filter that injects preload scripts into HTML responses
19
19
  // Injection happens right after <head> tag to ensure scripts run before page scripts
20
- class ElectrobunResponseFilter : public CefResponseFilter {
20
+ class SparkBunResponseFilter : public CefResponseFilter {
21
21
  private:
22
22
  std::string buffer_;
23
23
  bool injected_;
24
- PreloadScript electrobun_script_;
24
+ PreloadScript sparkbun_script_;
25
25
  PreloadScript custom_script_;
26
26
 
27
27
  public:
28
28
  // Constructor with PreloadScript structs (preferred)
29
- ElectrobunResponseFilter(const PreloadScript& electrobunScript,
29
+ SparkBunResponseFilter(const PreloadScript& sparkbunScript,
30
30
  const PreloadScript& customScript)
31
31
  : injected_(false),
32
- electrobun_script_(electrobunScript),
32
+ sparkbun_script_(sparkbunScript),
33
33
  custom_script_(customScript) {}
34
34
 
35
35
  // Constructor with raw strings (for compatibility)
36
- ElectrobunResponseFilter(const std::string& electrobunScript,
36
+ SparkBunResponseFilter(const std::string& sparkbunScript,
37
37
  const std::string& customScript = "")
38
38
  : injected_(false),
39
- electrobun_script_(electrobunScript),
39
+ sparkbun_script_(sparkbunScript),
40
40
  custom_script_(customScript) {}
41
41
 
42
42
  // Single script constructor (for simpler use cases)
43
- explicit ElectrobunResponseFilter(const std::string& script)
43
+ explicit SparkBunResponseFilter(const std::string& script)
44
44
  : injected_(false),
45
- electrobun_script_(script) {}
45
+ sparkbun_script_(script) {}
46
46
 
47
47
  bool InitFilter() override {
48
48
  buffer_.clear();
@@ -58,7 +58,7 @@ public:
58
58
  size_t& data_out_written) override {
59
59
 
60
60
  // If no scripts to inject, pass through directly
61
- if (electrobun_script_.empty() && custom_script_.empty()) {
61
+ if (sparkbun_script_.empty() && custom_script_.empty()) {
62
62
  size_t copy_size = std::min(data_in_size, data_out_size);
63
63
  std::memcpy(data_out, data_in, copy_size);
64
64
  data_in_read = copy_size;
@@ -137,14 +137,14 @@ private:
137
137
  }
138
138
 
139
139
  std::string BuildScriptTag() const {
140
- if (electrobun_script_.empty() && custom_script_.empty()) {
140
+ if (sparkbun_script_.empty() && custom_script_.empty()) {
141
141
  return "";
142
142
  }
143
143
 
144
144
  std::string result = "<script>\n";
145
145
 
146
- if (!electrobun_script_.empty()) {
147
- result += electrobun_script_.code;
146
+ if (!sparkbun_script_.empty()) {
147
+ result += sparkbun_script_.code;
148
148
  result += "\n";
149
149
  }
150
150
 
@@ -181,9 +181,9 @@ private:
181
181
  return buffer_.empty() ? RESPONSE_FILTER_DONE : RESPONSE_FILTER_NEED_MORE_DATA;
182
182
  }
183
183
 
184
- IMPLEMENT_REFCOUNTING(ElectrobunResponseFilter);
184
+ IMPLEMENT_REFCOUNTING(SparkBunResponseFilter);
185
185
  };
186
186
 
187
- } // namespace electrobun
187
+ } // namespace sparkbun
188
188
 
189
- #endif // ELECTROBUN_CEF_RESPONSE_FILTER_H
189
+ #endif // SPARKBUN_CEF_RESPONSE_FILTER_H
@@ -5,8 +5,8 @@
5
5
  //
6
6
  // This is a header-only implementation to avoid build complexity.
7
7
 
8
- #ifndef ELECTROBUN_CHROMIUM_FLAGS_H
9
- #define ELECTROBUN_CHROMIUM_FLAGS_H
8
+ #ifndef SPARKBUN_CHROMIUM_FLAGS_H
9
+ #define SPARKBUN_CHROMIUM_FLAGS_H
10
10
 
11
11
  #include <string>
12
12
  #include <vector>
@@ -18,7 +18,7 @@
18
18
  // pulling in the full CEF headers (the call sites already include them).
19
19
  #include "include/cef_command_line.h"
20
20
 
21
- namespace electrobun {
21
+ namespace sparkbun {
22
22
 
23
23
  struct ChromiumFlag {
24
24
  std::string name;
@@ -46,7 +46,7 @@ inline std::string readFileToString(const std::string& path) {
46
46
  // Handles three value types:
47
47
  // "flag-name": true -> add switch (hasValue = false)
48
48
  // "flag-name": "value" -> add switch with value (hasValue = true)
49
- // "flag-name": false -> skip a default flag set by Electrobun
49
+ // "flag-name": false -> skip a default flag set by SparkBun
50
50
  inline ChromiumFlagConfig parseChromiumFlags(const std::string& json) {
51
51
  ChromiumFlagConfig config;
52
52
 
@@ -176,6 +176,6 @@ inline void applyChromiumFlags(const ChromiumFlagConfig& config,
176
176
  }
177
177
  }
178
178
 
179
- } // namespace electrobun
179
+ } // namespace sparkbun
180
180
 
181
- #endif // ELECTROBUN_CHROMIUM_FLAGS_H
181
+ #endif // SPARKBUN_CHROMIUM_FLAGS_H
@@ -4,13 +4,13 @@
4
4
  //
5
5
  // This is a header-only implementation to avoid build complexity.
6
6
 
7
- #ifndef ELECTROBUN_CONFIG_H
8
- #define ELECTROBUN_CONFIG_H
7
+ #ifndef SPARKBUN_CONFIG_H
8
+ #define SPARKBUN_CONFIG_H
9
9
 
10
10
  #include <string>
11
11
  #include <mutex>
12
12
 
13
- namespace electrobun {
13
+ namespace sparkbun {
14
14
 
15
15
  // Thread-safe configuration singleton
16
16
  class Config {
@@ -61,6 +61,6 @@ private:
61
61
  std::string name_;
62
62
  };
63
63
 
64
- } // namespace electrobun
64
+ } // namespace sparkbun
65
65
 
66
- #endif // ELECTROBUN_CONFIG_H
66
+ #endif // SPARKBUN_CONFIG_H
@@ -4,14 +4,14 @@
4
4
  //
5
5
  // This is a header-only implementation to avoid build complexity.
6
6
 
7
- #ifndef ELECTROBUN_DOWNLOAD_EVENT_H
8
- #define ELECTROBUN_DOWNLOAD_EVENT_H
7
+ #ifndef SPARKBUN_DOWNLOAD_EVENT_H
8
+ #define SPARKBUN_DOWNLOAD_EVENT_H
9
9
 
10
10
  #include <string>
11
11
  #include <cstdint>
12
12
  #include <sstream>
13
13
 
14
- namespace electrobun {
14
+ namespace sparkbun {
15
15
 
16
16
  // Download event types
17
17
  enum class DownloadEventType {
@@ -192,6 +192,6 @@ private:
192
192
  DownloadEvent event_;
193
193
  };
194
194
 
195
- } // namespace electrobun
195
+ } // namespace sparkbun
196
196
 
197
- #endif // ELECTROBUN_DOWNLOAD_EVENT_H
197
+ #endif // SPARKBUN_DOWNLOAD_EVENT_H
@@ -4,14 +4,14 @@
4
4
  //
5
5
  // This is a header-only implementation to avoid build complexity.
6
6
 
7
- #ifndef ELECTROBUN_FFI_HELPERS_H
8
- #define ELECTROBUN_FFI_HELPERS_H
7
+ #ifndef SPARKBUN_FFI_HELPERS_H
8
+ #define SPARKBUN_FFI_HELPERS_H
9
9
 
10
10
  #include <string>
11
11
  #include <cstring>
12
12
  #include <cstdlib>
13
13
 
14
- namespace electrobun {
14
+ namespace sparkbun {
15
15
 
16
16
  // Create a copy of a string for FFI callbacks
17
17
  // The returned string is allocated with malloc/strdup and must be freed by the caller
@@ -127,13 +127,13 @@ public:
127
127
 
128
128
  // Create FFI string (caller must free)
129
129
  char* createFFIString() const {
130
- return electrobun::createFFIString(data_);
130
+ return sparkbun::createFFIString(data_);
131
131
  }
132
132
 
133
133
  private:
134
134
  std::string data_;
135
135
  };
136
136
 
137
- } // namespace electrobun
137
+ } // namespace sparkbun
138
138
 
139
- #endif // ELECTROBUN_FFI_HELPERS_H
139
+ #endif // SPARKBUN_FFI_HELPERS_H
@@ -4,13 +4,13 @@
4
4
  // This is a header-only implementation to avoid build complexity.
5
5
  // Supports * wildcard only, case-insensitive matching.
6
6
 
7
- #ifndef ELECTROBUN_GLOB_MATCH_H
8
- #define ELECTROBUN_GLOB_MATCH_H
7
+ #ifndef SPARKBUN_GLOB_MATCH_H
8
+ #define SPARKBUN_GLOB_MATCH_H
9
9
 
10
10
  #include <string>
11
11
  #include <cctype>
12
12
 
13
- namespace electrobun {
13
+ namespace sparkbun {
14
14
 
15
15
  // Simple case-insensitive glob matcher (supports * wildcard only)
16
16
  // Returns true if text matches the glob pattern
@@ -54,6 +54,6 @@ inline bool globMatch(const std::string& pattern, const std::string& text) {
54
54
  return p == pattern.size();
55
55
  }
56
56
 
57
- } // namespace electrobun
57
+ } // namespace sparkbun
58
58
 
59
- #endif // ELECTROBUN_GLOB_MATCH_H
59
+ #endif // SPARKBUN_GLOB_MATCH_H
@@ -5,13 +5,13 @@
5
5
  // This is a header-only implementation to avoid build complexity.
6
6
  // For complex JSON needs, use a proper JSON library instead.
7
7
 
8
- #ifndef ELECTROBUN_JSON_MENU_PARSER_H
9
- #define ELECTROBUN_JSON_MENU_PARSER_H
8
+ #ifndef SPARKBUN_JSON_MENU_PARSER_H
9
+ #define SPARKBUN_JSON_MENU_PARSER_H
10
10
 
11
11
  #include <string>
12
12
  #include <vector>
13
13
 
14
- namespace electrobun {
14
+ namespace sparkbun {
15
15
 
16
16
  // Represents a parsed menu item from JSON
17
17
  struct MenuItemJson {
@@ -218,6 +218,6 @@ inline std::vector<MenuItemJson> parseMenuJson(const std::string& jsonStr) {
218
218
  return items;
219
219
  }
220
220
 
221
- } // namespace electrobun
221
+ } // namespace sparkbun
222
222
 
223
- #endif // ELECTROBUN_JSON_MENU_PARSER_H
223
+ #endif // SPARKBUN_JSON_MENU_PARSER_H
@@ -4,12 +4,12 @@
4
4
  //
5
5
  // This is a header-only implementation to avoid build complexity.
6
6
 
7
- #ifndef ELECTROBUN_MIME_TYPES_H
8
- #define ELECTROBUN_MIME_TYPES_H
7
+ #ifndef SPARKBUN_MIME_TYPES_H
8
+ #define SPARKBUN_MIME_TYPES_H
9
9
 
10
10
  #include <string>
11
11
 
12
- namespace electrobun {
12
+ namespace sparkbun {
13
13
 
14
14
  // Get MIME type from a URL or file path based on extension
15
15
  // Returns "application/octet-stream" as default for unknown types
@@ -96,6 +96,6 @@ inline std::string getMimeTypeFromUrl(const std::string& url) {
96
96
  return "application/octet-stream"; // default
97
97
  }
98
98
 
99
- } // namespace electrobun
99
+ } // namespace sparkbun
100
100
 
101
- #endif // ELECTROBUN_MIME_TYPES_H
101
+ #endif // SPARKBUN_MIME_TYPES_H
@@ -4,14 +4,14 @@
4
4
  //
5
5
  // This is a header-only implementation to avoid build complexity.
6
6
 
7
- #ifndef ELECTROBUN_NAVIGATION_RULES_H
8
- #define ELECTROBUN_NAVIGATION_RULES_H
7
+ #ifndef SPARKBUN_NAVIGATION_RULES_H
8
+ #define SPARKBUN_NAVIGATION_RULES_H
9
9
 
10
10
  #include <string>
11
11
  #include <vector>
12
12
  #include "glob_match.h"
13
13
 
14
- namespace electrobun {
14
+ namespace sparkbun {
15
15
 
16
16
  // Represents a single navigation rule
17
17
  // Rules starting with "^" are block rules (inverts the match)
@@ -93,6 +93,6 @@ inline bool checkNavigationRulesForUrl(const std::string& rulesString,
93
93
  return checkNavigationRulesForUrl(rules, url, defaultAllow);
94
94
  }
95
95
 
96
- } // namespace electrobun
96
+ } // namespace sparkbun
97
97
 
98
- #endif // ELECTROBUN_NAVIGATION_RULES_H
98
+ #endif // SPARKBUN_NAVIGATION_RULES_H
@@ -25,15 +25,15 @@
25
25
  // context for that partition with a warning. The webview still loads;
26
26
  // isolation is lost for that one partition.
27
27
 
28
- #ifndef ELECTROBUN_PARTITION_CONTEXT_H
29
- #define ELECTROBUN_PARTITION_CONTEXT_H
28
+ #ifndef SPARKBUN_PARTITION_CONTEXT_H
29
+ #define SPARKBUN_PARTITION_CONTEXT_H
30
30
 
31
31
  #include <string>
32
32
  #include <map>
33
33
  #include <mutex>
34
34
  #include <cstdio>
35
35
 
36
- namespace electrobun {
36
+ namespace sparkbun {
37
37
 
38
38
  // Platform-provided. Returns the absolute filesystem cache_path for a
39
39
  // persistent partition with the given name (e.g. "test1"), creating any
@@ -132,6 +132,6 @@ inline CefRefPtr<CefRequestContext> getOrCreateRequestContextForPartition(
132
132
  return context;
133
133
  }
134
134
 
135
- } // namespace electrobun
135
+ } // namespace sparkbun
136
136
 
137
- #endif // ELECTROBUN_PARTITION_CONTEXT_H
137
+ #endif // SPARKBUN_PARTITION_CONTEXT_H
@@ -4,8 +4,8 @@
4
4
  //
5
5
  // This is a header-only implementation to avoid build complexity.
6
6
 
7
- #ifndef ELECTROBUN_PERMISSIONS_H
8
- #define ELECTROBUN_PERMISSIONS_H
7
+ #ifndef SPARKBUN_PERMISSIONS_H
8
+ #define SPARKBUN_PERMISSIONS_H
9
9
 
10
10
  #include <string>
11
11
  #include <map>
@@ -13,7 +13,7 @@
13
13
  #include <mutex>
14
14
  #include <utility>
15
15
 
16
- namespace electrobun {
16
+ namespace sparkbun {
17
17
 
18
18
  enum class PermissionType {
19
19
  USER_MEDIA,
@@ -113,6 +113,6 @@ inline void cachePermission(const std::string& origin, PermissionType type, Perm
113
113
  PermissionCache::getInstance().set(origin, type, status);
114
114
  }
115
115
 
116
- } // namespace electrobun
116
+ } // namespace sparkbun
117
117
 
118
- #endif // ELECTROBUN_PERMISSIONS_H
118
+ #endif // SPARKBUN_PERMISSIONS_H
@@ -2,8 +2,8 @@
2
2
  // Must be included AFTER include/cef_app.h (or any header that pulls in
3
3
  // internal/cef_types.h) so the CEF_PERMISSION_TYPE_* constants are available.
4
4
 
5
- #ifndef ELECTROBUN_PERMISSIONS_CEF_H
6
- #define ELECTROBUN_PERMISSIONS_CEF_H
5
+ #ifndef SPARKBUN_PERMISSIONS_CEF_H
6
+ #define SPARKBUN_PERMISSIONS_CEF_H
7
7
 
8
8
  // Consumers must already have included CEF headers that define
9
9
  // CEF_PERMISSION_TYPE_* (e.g. include/cef_app.h, which pulls in
@@ -13,7 +13,7 @@
13
13
  #include <cstdint>
14
14
  #include <cstdio>
15
15
 
16
- namespace electrobun {
16
+ namespace sparkbun {
17
17
 
18
18
  // Decode a CEF permission bitmask (as passed to OnShowPermissionPrompt) into a
19
19
  // human-readable comma-separated list of permission names. Used to build
@@ -69,6 +69,6 @@ inline std::string describeCefPermissions(uint32_t mask) {
69
69
  return out;
70
70
  }
71
71
 
72
- } // namespace electrobun
72
+ } // namespace sparkbun
73
73
 
74
- #endif // ELECTROBUN_PERMISSIONS_CEF_H
74
+ #endif // SPARKBUN_PERMISSIONS_CEF_H
@@ -3,14 +3,14 @@
3
3
  //
4
4
  // This is a header-only implementation to avoid build complexity.
5
5
 
6
- #ifndef ELECTROBUN_PRELOAD_SCRIPT_H
7
- #define ELECTROBUN_PRELOAD_SCRIPT_H
6
+ #ifndef SPARKBUN_PRELOAD_SCRIPT_H
7
+ #define SPARKBUN_PRELOAD_SCRIPT_H
8
8
 
9
9
  #include <string>
10
10
  #include <map>
11
11
  #include <mutex>
12
12
 
13
- namespace electrobun {
13
+ namespace sparkbun {
14
14
 
15
15
  // Represents a preload script to be injected into webviews
16
16
  struct PreloadScript {
@@ -66,6 +66,6 @@ private:
66
66
  std::map<int, std::string> scripts_;
67
67
  };
68
68
 
69
- } // namespace electrobun
69
+ } // namespace sparkbun
70
70
 
71
- #endif // ELECTROBUN_PRELOAD_SCRIPT_H
71
+ #endif // SPARKBUN_PRELOAD_SCRIPT_H