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! :-/
Related
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.
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.
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.
I now want to write extension for Safari.
But xCode offers me first make the app, and then add the safari extension.
OK, I created an empty application, started writing my extension, but I have a question. Can I release an extension without reference to the application? I do not understand the process.
I want to just create a safari extension, without reference to a particular application, because my product is a Safari extension, not a application.
I know it's late but somebody else might stumble upon this topic and I think the following information can be useful.
It seems that according to Apple's documentation extensions that are created using Safari Extension Builder will not longer be supported: https://developer.apple.com/library/archive/documentation/Tools/Conceptual/SafariExtensionGuide/Introduction/Introduction.html#//apple_ref/doc/uid/TP40009977-CH1-SW1
Developer-signed Safari extensions are not supported in Safari 12. Safari extensions distributed in the Safari Extension Gallery are deprecated, and Safari 12 is the last release to support them. Safari by default will turn off Safari extensions using canLoad. Instead, use Content Blocker extensions. New submissions to the Safari Extensions Gallery will be accepted until the end of 2018.
So the only way seems to be to
Use Safari app extensions to add features to the Safari browser.
https://developer.apple.com/documentation/safariservices/safari_app_extensions:
this looks like the only way to develop an extension as of today (2018), alas.
There are 2 types of Safari extensions: ones that bundled with a Mac app (Safari App Extensions) and standalone extensions. I belive standalone extensions can be created using Safari Extension Builder (avaliable in Develop menu in Safari), without Xcode. You can learn more about Safari extensions here.
As Safari extension Builder is deprecated, you now use Xcode. Simply, a Safari Extension can either be bundled with an app, or standalone. To start a new standalone extension, that is, not part of a desktop app:
Launch Xcode
Choose File > New > Project
Select the template Safari Extension App in the Other section
Click Next (continue through the normal process to develop your Safari Extension)
Alternatively, if you wanted to add a Safari Extension to your existing project:
Launch Xcode
Open your existing app project
Choose File > New > Target
Select the template Safari Extension App in the Other section
Click Next (continue through the normal process to develop your app including Safari Extension)
An example might be Grammarly whereby you can download a desktop client and Safari extension (in a bundle) for macOS, or you may download the extension as a standalone app from App Store.
Is there a way to go fullscreen in Xcode? similarly to VS.net ?
and if there is, how?
FWIW, the modern answer to this old question has two parts:
1) Use View->Fullscreen to go full screen
and ... so you don't end up with one fullscreen window per file (which would be ridiculous) ...
2a) Use Shift-Option-click to open new files in the same window
2b) Use Navigation Preferences to specify that files always open in a new tab
With Xcode 4.1, a build-in full screen mode in included.
It works pretty well if you don't use multiple monitors.
You could use the SIMBL plugin Megazoomer for that. That's a plugin that will add a zoom menu item to every Cocoa application which will show the app's content in full screen.
Slight problem though, it doesn't work with Xcode out of the box. Building the old version for 32Bit with GC enabled works when running Xcode 3.2.4 in 32-Bit mode. But unfortunately, Ian did not release the sources for the 64Bit version. So if you really really want it, ask him for the sources and build a version that runs in 64Bit Xcode.
I believe the newest version of Xcode is in an application window, so that would be able to 'go fullscreen'. Are you using the newest version of XCcde? http://developer.apple.com/technologies/tools/whats-new.html
it doesn't seem there's a decent one
Edit:
This was for XCode 3 and earlier, XCode 4 and later came in one window.
Please refer to other answers