Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ading2210/sandstone/llms.txt

Use this file to discover all available pages before exploring further.

Every ProxyFrame instance carries two properties that let you control how proxied pages behave: default_settings applies to all pages, and site_settings lets you override those defaults for specific hostnames. Settings are resolved at navigation time, so you can change them between navigations without recreating the frame.

Default settings

frame.default_settings is a plain object that acts as the baseline for every page loaded into the frame. The built-in default is:
frame.default_settings = { allow_js: true };
To disable JavaScript for all proxied pages globally, set allow_js to false:
main_frame.default_settings = { allow_js: false };

Per-site overrides

frame.site_settings is an array of objects. Each entry must include a hostname property containing a RegExp, plus any settings you want to override for pages whose hostname matches that pattern. When Sandstone navigates to a URL it searches site_settings for the first entry whose hostname regex matches frame.url.hostname. That entry is then shallow-merged on top of default_settings to produce the final settings object for the page.
main_frame.site_settings = [
  { hostname: /example\.com/, allow_js: false }
];
With the configuration above, pages on example.com load without JavaScript while all other pages continue to use default_settings (JavaScript enabled by default). You can stack multiple entries to apply different rules to different domains:
main_frame.site_settings = [
  { hostname: /example\.com/, allow_js: false },
  { hostname: /trusted-app\.io/, allow_js: true }
];
The first matching entry wins, so order the array from most specific to least specific.

Settings reference

allow_js
boolean
default:"true"
Controls whether inline and external JavaScript is evaluated for the proxied page. When set to false, Sandstone parses and renders the HTML but skips the script evaluation step entirely. Event handlers declared in HTML attributes and scripts loaded via <script> tags are both suppressed.

How settings are resolved

Internally, navigate_to() runs the following logic after fetching the page HTML:
let settings = this.site_settings.find((item) => {
  return item.hostname.test(this.url.hostname);
}) || {};
settings = { ...this.default_settings, ...settings };
The spread merge means any key present in the matching site_settings entry overrides the same key in default_settings, while keys absent from the entry inherit their value from default_settings.

Build docs developers (and LLMs) love