Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webkit ios 16.4 enable inspection #677

Merged

Conversation

spoxies
Copy link
Contributor

@spoxies spoxies commented Apr 13, 2023

Partial/copy of apache/cordova-ios#1300 credit to @BBosman

Platforms affected
iOS

Motivation and Context
With the introduction of iOS 16.4 WKWebView instances will no longer be inspectable by default.

Details: Enabling the Inspection of Web Content in Apps

Description
This PR honors that change for Release builds, but explicitly sets the inspectability to YES for Debug builds by default.
It also introduce an override option, so consumers can influence this decision in their own build.

@melounek
Copy link

yes please... found also fork doing the same thing: mochi-cards@8ed55ac

@jvjvjv
Copy link

jvjvjv commented May 29, 2023

There's an additional commit from 2021 that includes specific MIME types. IS that needed to set InspectableWebview to YES? If not, it may be what's holding up the Pull Request. @spoxies may I suggest making the change from a clean branch that matches what's in production? Maybe after that we can bug whoever on the Ionic team does pull requests and get it approved.

@spoxies spoxies force-pushed the webkit-ios-16.4-enable-inspection branch from 5e5bb96 to 0c49fc4 Compare June 2, 2023 17:29
@spoxies
Copy link
Contributor Author

spoxies commented Jun 2, 2023

@jvjvjv Thanks for the heads up , not sure how/why commit 0c2e273 is injected. Had forked directly from the ionic-team/[master] (https://github.com/ionic-team/cordova-plugin-ionic-webview/) using GH-Web.

Have reverted the injected commit for now (as multiple persons seem to be monitoring this PR all ready). The squash merge will solve it but I think the hold up is due to this repo being in hibernation.

@KBEMobisys
Copy link

Would be cool if we could get this fix into the next release as fast as possible. :) Can the maintainers please have a look on this?

@nicholaszuccarelli
Copy link

This is an important needed fix. I can't properly debug my iOS app now.

@phyr0s

This comment was marked as abuse.

JyrkiRytkonen added a commit to JyrkiRytkonen/cordova-plugin-ionic-webview that referenced this pull request Jul 19, 2023
@studentrk
Copy link

As a workaround I added the following code to the function getWebView() in node_modules/@capacitor/ios/Capacitor/Capacitor/CapacitorBridge.swift
I don't know if this is the correct way to do it, but after adding the lines the inspection via safari was possible again. I came across this post(https://stackoverflow.com/a/75975721/19561942).

public func getWebView() -> WKWebView? {
        if #available(iOS 16.4, *) {
            webView?.isInspectable = true
        }
        return webView
    }

NetEvolutions added a commit to werktools/cordova-plugin-ionic-webview that referenced this pull request Aug 28, 2023
@jvjvjv
Copy link

jvjvjv commented Aug 29, 2023

I just wanted to say this is the best news ever thank you giralte-ionic!

@giralte-ionic
Copy link
Contributor

The real trick is going to be getting this to publish so please be patient

@giralte-ionic giralte-ionic merged commit 9c11a20 into ionic-team:master Aug 29, 2023
@nicholaszuccarelli
Copy link

Legendary.

jfougere pushed a commit to jfougere/cordova-plugin-ionic-webview that referenced this pull request Aug 31, 2023
* extension -> mime explicit mapping

* Set webView.inspectable to true for debug builds on iOS >= 16.4

Duplicate/partial implementation of apache/cordova-ios#1300

---------

Co-authored-by: Pavel Kurdyukov <kurdyukov.pavel@gmail.com>
NetEvolutions added a commit to werktools/cordova-plugin-ionic-webview that referenced this pull request Aug 31, 2023
* commit 'e591d7c73bf0abe973b7a7eaaf8e95b50c0e5708':
  update package.json and changelog
  Webkit ios 16.4 enable inspection (ionic-team#677)
@gischy
Copy link

gischy commented Sep 25, 2023

what about ios 16.6 ? cant inspect my ionic cordova app, i tried with cordova-plugin-ionic-webview 5.0.1

@bobisum
Copy link

bobisum commented Oct 25, 2023

I'm facing the same issue with iOS 16.7.1

akrcc pushed a commit to akrcc/cordova-plugin-ionic-webview that referenced this pull request Dec 12, 2023
* extension -> mime explicit mapping

* Set webView.inspectable to true for debug builds on iOS >= 16.4

Duplicate/partial implementation of apache/cordova-ios#1300

---------

Co-authored-by: Pavel Kurdyukov <kurdyukov.pavel@gmail.com>
@amrivero
Copy link

amrivero commented Feb 5, 2024

I have IOS 17.3 and safari TP version 17.4. I can't inspect my ionic cordova application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet