MCPcopy Create free account
hub / github.com/d0iasm/saba / execute_js

Method execute_js

core/src/renderer/page.rs:172–188  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

170 }
171
172 fn execute_js(&mut self) {
173 let dom = match &self.frame {
174 Some(frame) => frame.borrow().document(),
175 None => return,
176 };
177
178 let js = get_js_content(dom.clone());
179 let lexer = JsLexer::new(js);
180
181 let mut parser = JsParser::new(lexer);
182 let ast = parser.parse_ast();
183
184 let mut runtime = JsRuntime::new(dom);
185 runtime.execute(&ast);
186
187 self.modified = runtime.dom_modified();
188 }
189
190 pub fn push_url_for_subresource(&mut self, src: String) {
191 // TODO: send a request to url and get a resource.

Callers 1

receive_responseMethod · 0.80

Calls 5

get_js_contentFunction · 0.85
documentMethod · 0.80
parse_astMethod · 0.80
executeMethod · 0.80
dom_modifiedMethod · 0.80

Tested by

no test coverage detected