kernl API
    Preparing search index...

    Function createGuardPipeline

    • Compose the guard: ingress flood control, then the visibility gate, then the focus-aware firewall, then kehto's bridge.

      What is enforced where (D-020): kehto binds NAP traffic to a MessagePort the bridge owns. Window-level messages, of which only napplet.hello is legitimate, are held or dropped by handleWindowMessage. Port traffic reaches observe through kehto's filterNappletMessage, whose answer kehto follows: dispatch, hold until releaseDeferred, or drop. Hidden windows' envelopes are held and onRelease is called when the window is visible again. Quarantine revokes the window inside the filter, and kehto discards what it held. The runtime firewall configured by applyRuntimeFirewallRules adds the profile's per-class rates to every envelope it dispatches, held ones included.

      Parameters

      Returns GuardPipeline

      The pipeline.

      const pipeline = createGuardPipeline({ config: createGuardConfig('strict'), onEvent: (e) => log.push(e) });
      window.addEventListener('message', (event) => pipeline.handleWindowMessage(event, resolve, bridge.handleMessage));