inspectdev / inspect-issues

Issue tracker for Inspect
22 stars 2 forks source link

Elements tool doesn't work with UIWebView #85

Closed auchenberg closed 2 years ago

auchenberg commented 3 years ago

I spent the rest of the day scratching my head as to what was different between your test case and my app and finally it dawned on me that this project uses UIWebView, not WKWebView. It's a legacy app that we're busily rewriting, but we need to keep going until the new capacitor version is at feature parity.

Here's how you can reproduce the issue. It might be possible with Capacitor to change the WebView, but I'm more familiar with Cordova. I've gone back to ionic1 for simplicity, but I believe this issue will occur on any version of ionic where you are using UIWebView.

Install Ionic/Cordova globals

npm install -g cordova@9.0.0
npm install -g @ionic/cli
npm install -g cordova-res

Start Ionic V1 Project

ionic start inspect-dev-test tabs --type=ionic1 --cordova
cd inspect-dev-test

Add the following to packages.json because ionic1 uses gulp v3

   "scripts": {
    "preinstall": "npx npm-force-resolutions"
  },
  "resolutions": {
    "graceful-fs": "^4.2.4"
  },
``

Add the following to config.xml to force UIWebView

Add the IOS Platform, then run npm install to apply graceful-fs, then prepare for Xcode

ionic cordova platform add ios npm install ionic cordova prepare ios



Now open platforms/ios/inspect-dev-test.xcworkspace in xcode

**Actual:**
There's nothing in the Elements tab and nothing in the Console.

**Expected:**
Elements tool to work
auchenberg commented 2 years ago

Demo app that has both UiWebView and WKWebView: https://github.com/authenticationfailure/WheresMyBrowser.iOS