注入执行 JS Injection execution JS script: 要执行的 JS 代码 return: 假如注入代码有返回值,则返回此值,否则返回 None script: JS code to be executed return: If the injection code has a return value, this value is returned, otherwise None is returned
(self, script: str)
| 8 | """ |
| 9 | |
| 10 | def execute_script(self, script: str) -> str: |
| 11 | """ |
| 12 | 注入执行 JS |
| 13 | Injection execution JS |
| 14 | |
| 15 | script: 要执行的 JS 代码 |
| 16 | return: 假如注入代码有返回值,则返回此值,否则返回 None |
| 17 | |
| 18 | script: JS code to be executed |
| 19 | return: If the injection code has a return value, this value is returned, otherwise None is returned |
| 20 | |
| 21 | 示例: |
| 22 | Examples: |
| 23 | result = execute_script('(()=>alert(123))()') |
| 24 | """ |
| 25 | response = self.SendData("executeScript", script) |
| 26 | if response == "null": |
| 27 | return None |
| 28 | return response |
| 29 | |
| 30 | |
| 31 |
no test coverage detected