mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-10-08 20:32:00 -04:00
iframe: add sandbox setter
This commit is contained in:
1 parent
6cd05967ed
commit
395550488a
1 file changed
+6
-1
@@ -101,6 +101,11 @@ fn getSandbox(self: *IFrame, frame: *Frame) !?*DOMTokenList {
|
||||
return element.getTokenList(.sandbox, frame);
|
||||
}
|
||||
|
||||
fn setSandbox(self: *IFrame, value: String, frame: *Frame) !void {
|
||||
const list = try self.getSandbox(frame) orelse return;
|
||||
return list.setValue(value, frame);
|
||||
}
|
||||
|
||||
pub const JsApi = struct {
|
||||
pub const bridge = js.Bridge(IFrame);
|
||||
|
||||
@@ -136,7 +141,7 @@ pub const JsApi = struct {
|
||||
return window._document;
|
||||
}
|
||||
}.wrap, null, .{});
|
||||
pub const sandbox = bridge.accessor(IFrame.getSandbox, null, .{ .null_as_undefined = true });
|
||||
pub const sandbox = bridge.accessor(IFrame.getSandbox, IFrame.setSandbox, .{ .null_as_undefined = true, .ce_reactions = true });
|
||||
};
|
||||
|
||||
pub const Build = struct {
|
||||
|
||||
Reference in new issue
Block a user