How to link custom build of WebKit in macos app using WKWebView? - xcode

I have a custom build of WebKit on my machine and would like to link my macOS app to it so that WKWebView uses my custom build instead of the default build of WebKit installed on macOS devices.
A similar question was asked before but the answered solution was to use the DYLD_FRAMEWORK_PATH which I do not want to do because I want to distribute this custom build of WebKit to all the users of my app as well.

Related

Appium WebView always rendered as NATIVE_APP (iOS and Android / Xamarin)

I am testing an iOS and Android Xamarin application using the Appium desktop tool (and therefore language agnostic). The application, when attempting to sign in, loads a webview. However, on both iOS and Android applications, Appium still sees the context as NATIVE_APP. I tried following the instructions here in case there was an issue with Appium desktop, but I got an array containing only NATIVE_APP when calling #driver.available_contexts (Ruby), so I don't believe that's the issue. I AM able to inspect the login page using Safari / Develop / Simulator, so I am unsure who Appium can't see the webview. Any help would be appreciated.
Note - I have another native application that uses the same login intercept webview, and appium DOES see the Webview. So it's entirely possible that this is related to Xamarin. But I have no way of knowing for certain
Can you check the below setup according to appium docs for android.
There is an additional step necessary within your app build, unfortunately. As described in the Android remote debugging docs it is necessary to set to true the setWebContentsDebuggingEnabled property on the android.webkit.WebView element.

Mac Catalyst, unable to create a Safari Extension

I've started a new iOS project enabling the option to deploy the same app in macOS (Catalyst). But when I try to create a Safari Extension in macOS, I get the following error
'Safari Extension.appex' is a Safari extension, which is not available when building for Mac Catalyst. You may need to restrict the platforms for which this app extension should be embedded in the target editor.
In the target editor Frameworks, Libraries and Embedded Content I've selected only the macOS platform in my Safari Extension, but I get the same error, any clue?
thanks for your time
I've received an answer from Apple
Embedding a Safari App Extension in a Catalyst app currently isn't
supported. If you could file a piece of Feedback in Feedback Assistant
that would be very helpful. Thanks!
https://forums.developer.apple.com/thread/122485

Create a "Safari App Extension" for macOS application created with Electron?

Since the release of "Safari App Extension" I have toyed around with creating safari app extensions for native applications using xcode. Now however, I'm attempting to create an extension for an application that was built using the Electron Framework.
I'm wondering if this is possible and if anyone has had any luck accomplishing this goal. I'm unsure how to go about initiating the safari app extension without the use of xcode.
For those unfamiliar with "Safari App Extension" you can add one to an existing native project by opening a MacOS application, going to "File->New->Target->Safari Extension" this will then create the extension within your existing application and make the extension available within Safari->Preferences->Extensions.
Thank you for reading.
I'm not secure if what I'm saying it's true, but I think that Safari Extensions are writed with Safari apis and/or a language that it isn't javascript (because, on my old Mac, I needed to install an adblocker app with .app extension). The problem is that Electron is based by Chromium and requires javascript and Chromium based extensions. If you want, however, you can do the inverse.
If you are not expert with Chromium extensions, I suggest to you this link.
P.S.: You can also try to find the same or similar extension that works on Chromium.

AR vuforia integration with xcode

I have two projects. One is native iOS app (UIKIT) and the other is AR Vuforia project which was made by Unity3D.
I can export AR project into XCODE project, but I am wondering how to link them together.
For example, I have a button on native iOS app. I want to trigger AR project when button is pressed and it can go back to native iOS app as well.
Are you saying that you want to have one app launch another (and vice-versa)?
If that is the case, then you just need to learn about Apple's URL scheme, which is described here:
https://developer.apple.com/library/ios/featuredarticles/iPhoneURLScheme_Reference/Introduction/Introduction.html
It is really quite easy to use. You'll need to edit the PList for each app to give them a custom URL, which you can then invoke via the openURL method:
https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIApplication_Class/Reference/Reference.html#//apple_ref/occ/instm/UIApplication/openURL:

Using WebKit.framework from WebKit nightly in Cocoa app?

I'm currently using WebView in a Cocoa app, I'd also like to use the HTML5 File API, within webview (specifically FileReader). FileReader is not supported in the latest version of WebKit, but it is supported in WebKit nightly. How would I go about using the WebKit.framework from webkit nightly for my app?
I've tried:
1. installing webkit nightly and adding the WebKit.framework within WebKit.app to my cocoa app, that did not enable FileReader...
2. Changing the import statement to point to the WebKit.framework within WebKit.app... that did not work either.
If you mount the WebKit nightly build disk image, you can temporarily tell your app to use that library instead of the built-in WebKit by setting this environment variable:
DYLD_FRAMEWORK_PATH=/Volumes/WebKit/WebKit.app/Contents/Frameworks/10.9
To set this in Xcode 4, click on the Scheme popup and choose Edit Scheme. Next, click the Arguments tab and add a new environment variable, with the name DYLD_FRAMEWORK_PATH and the value /Volumes/WebKit/WebKit.app/Contents/Frameworks/10.9.
Note that this is for development only, and will not work for end users.
It is generally a really bad idea to use a custom version of WebKit in a shipping app, but if you absolutely must ship a development version of WebKit to your users, you should build it from source and link directly to that code. You would probably need to build WebCore as well. Yay, fun times! :-/

Resources