[Debug Flag Webview] Impossible to debug iPhone with safari since iOS 16.4

Hello there,

With iOS 16.4 Apple added a debug flag on the webview to know if we can enable debugging in safari technology preview or not. This evaluates to false by default, so we can’t debug an iPhone.

This seems to be fixed cordova-ios on the 6.3.0 version.
But if we use the ionic-webview, this still does not be updated and we still can’t debug the iPhone.

See this linked tickets : Mark the webview as inspectable in iOS 16.4 · Issue #1301 · apache/cordova-ios · GitHub

Is it possible to do something about this ?


Any news on this ?

Have you tried Capacitor 5?

I’m using cordova & cordova-ios, not capacitor.

I am assuming you are referring to the cordova-plugin-ionic-webview plugin when you say ionic-webview? It hasn’t been updated for three years. For long term support, you are going to want to switch to Capacitor.

1 Like

That’s what I thought… Actually, it’s an old project that I didn’t want to spend a lot of time on, I just want to quickly fix some bugs, and was hoping I can debug without migrating the whole thing…

Thanks anyway guys !

You don’t need cordova-plugin-ionic-webview anymore if you are using cordova-ios 6.3.0, unless you are using ionic appflow deploy feature.

1 Like

Oh perfect, i didn’t think of this, thanks mate !

Hi again @julio-ionic, since i removed the cordova-plugin-ionic-webview, the splashcreen never hide do you have any idea ?

cordova-plugin-ionic-webview doesn’t do anything with the splash screen, so without it, it should work the same way.

How are you hiding the splash screen?
Do you call navigator.splashscreen.hide(); anywhere in the code? or use <preference name="AutoHideSplashScreen" value="true" /> in your config.xml?

Yes, but it feels like the webview never loads.

in config.xml i have :

 <preference name="SplashMaintainAspectRatio" value="true" />
    <preference name="FadeSplashScreenDuration" value="300" />
    <preference name="SplashShowOnlyFirstTime" value="false" />
    <preference name="SplashScreen" value="screen" />
    <preference name="AutoHideSplashScreen" value="false" />
    <platform name="ios">
        <preference name="SplashScreenDelay" value="3000" />
        <preference name="WKWebViewOnly" value="true" />
        <preference name="keyboardResize" value="false" />
        <preference name="keyboardResizeMode" value="none" />
        <feature name="CDVWKWebViewEngine">
            <param name="ios-package" value="CDVWKWebViewEngine" />

And i’m using in app.component.ts :
this.platform.ready().then(() => { // some verifications... this.splashScreen.hide(); });

So, when i set the autoHide to true, i just get a white page with nothing and no errors, it feels like platforms is never ready, while when i have the ionic-webview, it loads normally.
And this is the case only for ios, it working fine with android.

Ah, cordova-ios still uses file:// by default and that doesn’t play well with most frameworks, you’ll have to configure a scheme so it works the same way ionic webview plugin works.
In example add this so it uses the same scheme ionic webview uses
<preference name="scheme" value="ionic" /> (inside the ios platform block)

1 Like

Oh yes, thank you man, I never would have thought of that !