Created
April 29, 2021 21:26
-
-
Save subtleGradient/1195757cc9e84f06f076a8d3d4fcc5c7 to your computer and use it in GitHub Desktop.
Safari iOS Debug.jxa.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env osascript -l JavaScript | |
// macOS JXA JavaScript for Automation | |
// eslint-disable-next-line @typescript-eslint/no-unused-vars | |
function run(argv) { | |
Application('Safari').activate(); | |
const { Safari } = Application('System Events').applicationProcesses; | |
const { Develop } = Safari.menuBars[0].menuBarItems; | |
const Debugables = Develop.menus[0].menuItems | |
.whose({ name: { _beginsWith: 'Simulator ' } })[0] | |
.menus[0].menuItems(); | |
[].slice.call(Debugables, 0, -3) | |
.map(it => it.click()); | |
Develop.click(); // This shouldn't be necessary, but… it is anyway 🤷 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment