<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Create JS Bridge</title><link>https://sourceforge.net/p/sucrose/wiki/Create%2520JS%2520Bridge/</link><description>Recent changes to Create JS Bridge</description><atom:link href="https://sourceforge.net/p/sucrose/wiki/Create%20JS%20Bridge/feed" rel="self"/><language>en</language><lastBuildDate>Sat, 04 Jul 2026 04:15:50 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/sucrose/wiki/Create%20JS%20Bridge/feed" rel="self" type="application/rss+xml"/><item><title>Create JS Bridge modified by Bayram Emekli</title><link>https://sourceforge.net/p/sucrose/wiki/Create%2520JS%2520Bridge/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v2
+++ v3
@@ -71,7 +71,7 @@
 | `ShuffleMode` | shuffle state | `SucroseShuffleMode({0});` |
 | `StretchMode` | `None`/`Fill`/`Uniform`/`UniformToFill` | `SucroseStretchMode({0});` |
 | `VolumeLevel` | volume level | `SucroseVolumeLevel({0});` |
-| `SystemAudio` | Audio object (incl. FFT `Data` array) | `SucroseAudioData({0});` |
+| `SystemAudio` | Audio object (incl. FFT `Data`, `DataLeft`, `DataRight` spectra) | `SucroseAudioData({0});` |
 | `SystemBios` | Bios object | `SucroseBiosData({0});` |
 | `SystemDate` | Date object | `SucroseDateData({0});` |
 | `SystemMemory` | Memory object | `SucroseMemoryData({0});` |
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Bayram Emekli</dc:creator><pubDate>Sat, 04 Jul 2026 04:15:50 -0000</pubDate><guid>https://sourceforge.net2350482867e87834a6b5640e2624282984c014a1</guid></item><item><title>Create JS Bridge modified by Bayram Emekli</title><link>https://sourceforge.net/p/sucrose/wiki/Create%2520JS%2520Bridge/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v1
+++ v2
@@ -16,7 +16,7 @@

 The JavaScript bridge is delivered **only by the browser‑style engines**: **WebView** (Microsoft Edge WebView2) and **CefSharp** (Chromium Embedded Framework). It is therefore available to the **`Web`** wallpaper type (and to the built‑in HTML wrappers used for Gif/Video/YouTube). It is **not** available to:

-- the **MpvPlayer**, **Nebula**, **Vexana**, or **Xavier** engines (pure media playback), or
+- the **MpvPlayer**, **VlcPlayer**, **Nebula**, **Vexana**, or **Xavier** engines (pure media playback), or

 - the **Aurora** engine (native `Application` embedding — apps receive volume only).

 So **audio‑reactive** and **system‑status** wallpapers must be the **`Web`** type rendered by **WebView** or **CefSharp**. See [Engine Comparison](Engine-Comparison) and [Engines Overview](Engines-Overview).
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Bayram Emekli</dc:creator><pubDate>Sat, 04 Jul 2026 04:15:49 -0000</pubDate><guid>https://sourceforge.net8587edf27d69a242f53fab5d19db9dc366b68870</guid></item><item><title>Create JS Bridge modified by Bayram Emekli</title><link>https://sourceforge.net/p/sucrose/wiki/Create%2520JS%2520Bridge/</link><description>&lt;div class="markdown_content"&gt;&lt;h1 id="h-the-javascript-bridge-sucrosecompatiblejson"&gt;The JavaScript Bridge — &lt;code&gt;SucroseCompatible.json&lt;/code&gt;&lt;/h1&gt;
&lt;p&gt;&lt;em&gt;Audience: wallpaper creators and developers.&lt;/em&gt; Web wallpapers can opt into receiving &lt;strong&gt;live audio and system data&lt;/strong&gt; and &lt;strong&gt;engine‑state changes&lt;/strong&gt; from Sucrose through a JavaScript bridge. This page explains how a page detects that it is running inside Sucrose, the &lt;code&gt;SucroseCompatible.json&lt;/code&gt; hook/template model that drives the bridge, the full list of available hooks, and which engines deliver them. The two big data feeds get their own pages: &lt;a href="./Create-Audio-API"&gt;Create Audio API&lt;/a&gt; and &lt;a href="./Create-System-API"&gt;Create System API&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="h-contents"&gt;Contents&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#which-engines-deliver-the-bridge"&gt;Which engines deliver the bridge&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#detecting-sucrose"&gt;Detecting Sucrose&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#the-hooktemplate-model"&gt;The hook/template model&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#full-hook-list"&gt;Full hook list&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#worked-examples"&gt;Worked examples&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#notes-and-gotchas"&gt;Notes and gotchas&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#see-also"&gt;See also&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="h-which-engines-deliver-the-bridge"&gt;Which engines deliver the bridge&lt;/h2&gt;
&lt;p&gt;The JavaScript bridge is delivered &lt;strong&gt;only by the browser‑style engines&lt;/strong&gt;: &lt;strong&gt;WebView&lt;/strong&gt; (Microsoft Edge WebView2) and &lt;strong&gt;CefSharp&lt;/strong&gt; (Chromium Embedded Framework). It is therefore available to the &lt;strong&gt;&lt;code&gt;Web&lt;/code&gt;&lt;/strong&gt; wallpaper type (and to the built‑in HTML wrappers used for Gif/Video/YouTube). It is &lt;strong&gt;not&lt;/strong&gt; available to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;the &lt;strong&gt;MpvPlayer&lt;/strong&gt;, &lt;strong&gt;Nebula&lt;/strong&gt;, &lt;strong&gt;Vexana&lt;/strong&gt;, or &lt;strong&gt;Xavier&lt;/strong&gt; engines (pure media playback), or&lt;/li&gt;
&lt;li&gt;the &lt;strong&gt;Aurora&lt;/strong&gt; engine (native &lt;code&gt;Application&lt;/code&gt; embedding — apps receive volume only).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So &lt;strong&gt;audio‑reactive&lt;/strong&gt; and &lt;strong&gt;system‑status&lt;/strong&gt; wallpapers must be the &lt;strong&gt;&lt;code&gt;Web&lt;/code&gt;&lt;/strong&gt; type rendered by &lt;strong&gt;WebView&lt;/strong&gt; or &lt;strong&gt;CefSharp&lt;/strong&gt;. See &lt;a href="./Engine-Comparison"&gt;Engine Comparison&lt;/a&gt; and &lt;a href="./Engines-Overview"&gt;Engines Overview&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="h-detecting-sucrose"&gt;Detecting Sucrose&lt;/h2&gt;
&lt;p&gt;A web wallpaper detects that it is running inside Sucrose by checking the &lt;strong&gt;User‑Agent&lt;/strong&gt;:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;navigator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;userAgent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;startsWith&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Sucrose"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;// running inside Sucrose — define the Sucrose* callbacks&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The default User‑Agent string is:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;Sucrose/2.3 (Windows NT 10.0; Wallpaper Engine) SucroseWebKit
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;This is overridable by the user via the &lt;code&gt;UserAgent&lt;/code&gt; general setting, but it always begins with &lt;code&gt;Sucrose&lt;/code&gt;, so &lt;code&gt;startsWith("Sucrose")&lt;/code&gt; is the reliable check. For porting wallpapers that target other engines, feature‑detect first and fall back to the Sucrose API — see &lt;a href="./Create-Compatibility"&gt;Create Compatibility&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="h-the-hooktemplate-model"&gt;The hook/template model&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;SucroseCompatible.json&lt;/code&gt; is a &lt;strong&gt;flat JSON dictionary of JavaScript‑call templates&lt;/strong&gt;. Each value is a &lt;code&gt;string.Format&lt;/code&gt; template where &lt;code&gt;{0}&lt;/code&gt; is substituted with the JSON payload for that data feed. The engine fires a hook &lt;strong&gt;only if&lt;/strong&gt; the corresponding string is non‑empty.&lt;/p&gt;
&lt;p&gt;For each enabled feed the engine runs &lt;code&gt;string.Format(template, payloadJson)&lt;/code&gt; via &lt;code&gt;ExecuteScriptAsync&lt;/code&gt; inside the page. Critically, &lt;strong&gt;the JavaScript function name on the right side is chosen by you&lt;/strong&gt; — Sucrose just runs whatever template you provide. By convention every shipped wallpaper uses the &lt;code&gt;Sucrose&amp;lt;Thing&amp;gt;Data&lt;/code&gt; names, and that is the documented standard.&lt;/p&gt;
&lt;p&gt;For example, this hook:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;"SystemAudio"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"SucroseAudioData({0});"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;causes Sucrose, on each audio update, to call:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nx"&gt;SucroseAudioData&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="cm"&gt;/* audio payload, including the FFT Data array */&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;so you define:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;SucroseAudioData&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;// obj.Data is the FFT spectrum; see Create-Audio-API&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2 id="h-full-hook-list"&gt;Full hook list&lt;/h2&gt;
&lt;p&gt;All keys are optional strings; include only the ones you need.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Key&lt;/th&gt;
&lt;th&gt;Payload (&lt;code&gt;{0}&lt;/code&gt;)&lt;/th&gt;
&lt;th&gt;Conventional template&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;LoopMode&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;loop state&lt;/td&gt;
&lt;td&gt;&lt;code&gt;SucroseLoopMode({0});&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ThemeType&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;light/dark theme&lt;/td&gt;
&lt;td&gt;&lt;code&gt;SucroseThemeType({0});&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;SystemTheme&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;light/dark theme&lt;/td&gt;
&lt;td&gt;(alias of theme)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ShuffleMode&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;shuffle state&lt;/td&gt;
&lt;td&gt;&lt;code&gt;SucroseShuffleMode({0});&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;StretchMode&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;None&lt;/code&gt;/&lt;code&gt;Fill&lt;/code&gt;/&lt;code&gt;Uniform&lt;/code&gt;/&lt;code&gt;UniformToFill&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;SucroseStretchMode({0});&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;VolumeLevel&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;volume level&lt;/td&gt;
&lt;td&gt;&lt;code&gt;SucroseVolumeLevel({0});&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;SystemAudio&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Audio object (incl. FFT &lt;code&gt;Data&lt;/code&gt; array)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;SucroseAudioData({0});&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;SystemBios&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Bios object&lt;/td&gt;
&lt;td&gt;&lt;code&gt;SucroseBiosData({0});&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;SystemDate&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Date object&lt;/td&gt;
&lt;td&gt;&lt;code&gt;SucroseDateData({0});&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;SystemMemory&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Memory object&lt;/td&gt;
&lt;td&gt;&lt;code&gt;SucroseMemoryData({0});&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;SystemBattery&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Battery object&lt;/td&gt;
&lt;td&gt;&lt;code&gt;SucroseBatteryData({0});&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;SystemGraphic&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Graphic object&lt;/td&gt;
&lt;td&gt;&lt;code&gt;SucroseGraphicData({0});&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;SystemNetwork&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Network object&lt;/td&gt;
&lt;td&gt;&lt;code&gt;SucroseNetworkData({0});&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;SystemStorage&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Storage object&lt;/td&gt;
&lt;td&gt;&lt;code&gt;SucroseStorageData({0});&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;SystemProcessor&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Processor object&lt;/td&gt;
&lt;td&gt;&lt;code&gt;SucroseProcessorData({0});&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;SystemMotherboard&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Motherboard object&lt;/td&gt;
&lt;td&gt;&lt;code&gt;SucroseMotherboardData({0});&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The data feeds in detail:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;SystemAudio&lt;/code&gt; — the audio‑reactive feed (FFT spectrum + now‑playing metadata). See &lt;a href="./Create-Audio-API"&gt;Create Audio API&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;SystemProcessor&lt;/code&gt;, &lt;code&gt;SystemGraphic&lt;/code&gt;, &lt;code&gt;SystemMemory&lt;/code&gt;, &lt;code&gt;SystemNetwork&lt;/code&gt;, &lt;code&gt;SystemBattery&lt;/code&gt;, &lt;code&gt;SystemStorage&lt;/code&gt;, &lt;code&gt;SystemMotherboard&lt;/code&gt;, &lt;code&gt;SystemBios&lt;/code&gt;, &lt;code&gt;SystemDate&lt;/code&gt; — the system feeds. See &lt;a href="./Create-System-API"&gt;Create System API&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;LoopMode&lt;/code&gt;, &lt;code&gt;ShuffleMode&lt;/code&gt;, &lt;code&gt;StretchMode&lt;/code&gt;, &lt;code&gt;ThemeType&lt;/code&gt;/&lt;code&gt;SystemTheme&lt;/code&gt;, &lt;code&gt;VolumeLevel&lt;/code&gt; — engine‑state callbacks. See &lt;a href="./Create-Property-Listener-Filters"&gt;Create Property Listener Filters&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Enabling any &lt;code&gt;System*&lt;/code&gt; (or &lt;code&gt;SystemAudio&lt;/code&gt;) hook causes the engine to turn on the Backgroundog data channel for this wallpaper and start a communication transport — see &lt;a href="./Create-Web-Architecture"&gt;Create Web Architecture&lt;/a&gt; and &lt;a href="./IPC"&gt;IPC&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="h-worked-examples"&gt;Worked examples&lt;/h2&gt;
&lt;p&gt;A pure audio‑reactive wallpaper (&lt;code&gt;Fluid Simulation&lt;/code&gt;):&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;"SystemAudio"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"SucroseAudioData({0});"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;A system‑monitor wallpaper (&lt;code&gt;Simple System&lt;/code&gt;):&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nt"&gt;"SystemMemory"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"SucroseMemoryData({0});"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nt"&gt;"SystemGraphic"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"SucroseGraphicData({0});"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nt"&gt;"SystemNetwork"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"SucroseNetworkData({0});"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nt"&gt;"SystemProcessor"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"SucroseProcessorData({0});"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Matching JavaScript (with a Wallpaper‑Engine/Lively fallback, as the showcase wallpapers do):&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;wallpaperRegisterAudioListener&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;// Wallpaper Engine / Lively style&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;wallpaperRegisterAudioListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;frequencyArray&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;navigator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;userAgent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;startsWith&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Sucrose"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;// Sucrose style — name matches the template in SucroseCompatible.json&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;SucroseAudioData&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;frequencyArray&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Data&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2 id="h-notes-and-gotchas"&gt;Notes and gotchas&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Templates are &lt;code&gt;string.Format&lt;/code&gt; strings&lt;/strong&gt; — each must contain &lt;code&gt;{0}&lt;/code&gt; (the property listener template in &lt;code&gt;SucroseProperties.json&lt;/code&gt; needs both &lt;code&gt;{0}&lt;/code&gt; and &lt;code&gt;{1}&lt;/code&gt;). A literal &lt;code&gt;{&lt;/code&gt; or &lt;code&gt;}&lt;/code&gt; in the template would need escaping.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The function names are arbitrary&lt;/strong&gt;, but the ecosystem standard is &lt;code&gt;Sucrose&amp;lt;Thing&amp;gt;Data&lt;/code&gt; / &lt;code&gt;SucrosePropertyListener&lt;/code&gt;. Stick to the standard so your wallpaper interoperates with examples and tooling.&lt;/li&gt;
&lt;li&gt;Empty strings disable a hook — Sucrose only fires hooks whose value is non‑empty.&lt;/li&gt;
&lt;li&gt;Only the &lt;strong&gt;browser engines&lt;/strong&gt; deliver the bridge; do not rely on it for &lt;code&gt;Application&lt;/code&gt; wallpapers.&lt;/li&gt;
&lt;li&gt;Define your callbacks on &lt;code&gt;window&lt;/code&gt; (or globally) so the engine's injected &lt;code&gt;ExecuteScriptAsync&lt;/code&gt; calls can reach them.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="h-see-also"&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="./Create-Audio-API"&gt;Create Audio API&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="./Create-System-API"&gt;Create System API&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="./Create-Property-Listener-Filters"&gt;Create Property Listener Filters&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="./Create-Web-Architecture"&gt;Create Web Architecture&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="./Create-Compatibility"&gt;Create Compatibility&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Bayram Emekli</dc:creator><pubDate>Sat, 04 Jul 2026 04:15:22 -0000</pubDate><guid>https://sourceforge.net4de70304338125d68e3b582833e051db7a07cded</guid></item></channel></rss>