HimbeersaftLP/ios-safari-remote-debug-kit
حول
Remotely debugging iOS Safari on Windows and Linux
تطوير الويب والتطبيقاتالنمو المقاس للنجوم
- خلال 24 ساعة
- ٠
- خلال 7 أيام
- +١
- خلال 15 يومًا
- +٢
- خلال شهر
- جارٍ جمع السجل
تغيّر صافي النجوم خلال فترات متداخلة، وليس مجموعًا يوميًا. تبقى القياسات المفقودة فارغة. النجوم تقيس الاهتمام لا جودة البرمجيات.
README.md
الأصلRemote Debugging iOS Safari on Windows and Linux
Using this project you can debug your websites and web applications running in iOS Safari from a PC running Windows or Linux.
It provides a free and up-to-date alternative to the discontinued remotedebug-ios-webkit-adapter by RemoteDebug and is the spiritual successor to the abandoned webkit-webinspector by Arty Gus. It is a free and open source alternative to inspect.dev.
The setup scripts (generate.sh or generate.ps1) download the latest version of WebKit's built-in WebInspector and patch it to work with the WebSocket ios-webkit-debug-proxy provides and to be compatible with Chromium based browsers.
Having trouble getting this tool running? Join the Discord community:
If you are looking for a more modern, self-contained tool built in Go, check out Hazel's ios-safari-remote-debug.
Requirements for running
ios-webkit-debug-proxy- On Windows, it will automatically be downloaded, but you must also install and trust the device in Apple Devices (formerly in iTunes) for it to work
- For Linux, please follow the installation instructions.
- Node.JS http-server or Python or PHP
- If you have Python or PHP on your system, you don't need to change anything
- If you have Node.JS on your system, just run
npm i -g http-serverand you're set.
- A Chromium based browser
- like Google Chrome, Edge or Opera
- or WebKit based browser
- like Epiphany/GNOME Web
Requirements for setup
git(required bygenerate.shorgenerate.ps1) for downloading WebKit source code- On Windows, I suggest using
gitfor Windows in PowerShell - On Linux, I suggest installing
gitfrom your package manager
- On Windows, I suggest using
Instructions
Setup
- Clone this repository to your PC
- On Windows, run
generate.ps1. On Linux, rungenerate.sh.
This will result in the folder WebKit being created inside src. It contains the WebInspector files.
Running
- Plug your iOS device into your PC via USB
- On Windows, open Apple Devices (formerly iTunes) and mark the iOS device as trusted (pop-up asks for confirmation the first time you connect a new device)
- On the iOS device, confirm that you trust the connection if asked
- Go to
Settings->Safari->Advanced->Web Inspectorand enable it - Open the website you want to debug in Safari
- On Windows, run
start.ps1. On Linux, runstart.sh. Make sure your iOS device's screen is unlocked. - The
ios-webkit-debug-proxywill show your iOS device's name as connected. - Then open
http://localhost:8080/in the Chromium or WebKit based browser of your choice and click the page you want to debug- This overview page requires
ios-webkit-debug-proxyv1.9.2 or newer. With an older version, open the inspector directly instead:http://localhost:8080/Main.html?ws=localhost:9222/devtools/page/1, looking up the page number at the end of the URL at http://localhost:9222/
- This overview page requires
- You should be greeted with the WebInspector and can now debug to your heart's content.
Troubleshooting
- If http://localhost:8080/ says
Could not load http://localhost:9221/, yourios-webkit-debug-proxyis older than v1.9.2, which added the CORS headers the page needs. Use the direct URL from step 8 instead. - If you get an error like
Uncaught (in promise) Error: 'Browser' domain was not foundfromConnection.js:162you are trying to inspect a page that is not inspectable (this could be caused by having Safari extensions installed). Refer to http://localhost:9222/ for the available pages and put the correct one at the end of the URL (for examplehttp://localhost:8080/Main.html?ws=localhost:9222/devtools/page/2) for inspecting the second page. - In case your inspector window stays empty, open the dev tools of your local browser to check the console for errors.
- If you get an error like
WebSocket connection to 'ws://localhost:9222/devtools/page/1' failed:fromBrowserInspectorFrontendHost.js:97, try unplugging your device and plugging it back in while the site you want to debug is open in Safari. Once you see the ios-webkit-debug-proxy console window display a message likeConnected :9222 to Himbeers iPad (...), refresh the inspector page inside your browser (do not use the refresh button on the inspector page, refresh the entire site from your browser).
- If you get an error like
- In case you get strange javascript errors, make sure to have the latest version available. After a version upgrade could happen that a stale cache is served from the browser. Some mitigations:
ensure "Disable cache" in enabled in the broswer
Developer Toolsforhttp://localhost:8080/the
startscript could be changed to force a-c-1(that means "no cache"):start.ps1
http-server.ps1 -a $SRV_HOST -p $PORT $DIR 2>&1 | Out-Null http-server.ps1 -a $SRV_HOST -p $PORT -c-1 $DIR 2>&1 | Out-Nullstart.sh
http-server -a $HOST -p $PORT $DIR http-server -a $HOST -p $PORT -c-1 $DIR
Exiting
Windows
- Two windows will open. One manages the web server and the other one is
ios-webkit-debug-proxy. - To exit, close the
ios-webkit-debug-proxywindow, the other one will close automatically- Alternatively you can also press Ctrl+C in the web server window
Linux
- Press Ctrl+C in the terminal window to exit
Known Issues
- "Events" on the "Timelines" tab don't work
- Canvas content doesn't show on the "Graphics" tab
- Minor style glitches due to Webkit vs. Chromium differences
Notes
If you want to see details about how this was made, you can read a detailed explanation in HOW_IT_WORKS.md (note that this document only describes how the very first version of this tool was created and might not be completely up-to-date).
Attribution
- This project was made possible thanks to
- webkit-webinspector for the idea
- ios-webkit-debug-proxy for the ios-webkit-debug-proxy tool
- WebKit for the WebInspector itself
استكشف مشاريع مشابهة ومرتبطة
جارٍ التحميل…