WKWebView | OSX Swift 3 Demo App to show web content | iOS library

 by   mbarnig Swift Version: V0.9-2 License: MIT

kandi X-RAY | WKWebView Summary

kandi X-RAY | WKWebView Summary

WKWebView is a Swift library typically used in Mobile, iOS, macOS applications. WKWebView has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

OSX Swift 5 demo app to show web content in a WkWebView with WebKit. The present OS X Swift Class is related to the medical project RadioLogic. The program has been developed and documented for my own needs. I think it may be of interest to other developers. For this reason I made it available as a public GitHub. If you find it useful, you are welcome. Additional Informations are available in the project Wiki.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              WKWebView has a low active ecosystem.
              It has 23 star(s) with 12 fork(s). There are 3 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 0 open issues and 3 have been closed. On average issues are closed in 156 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of WKWebView is V0.9-2

            kandi-Quality Quality

              WKWebView has 0 bugs and 0 code smells.

            kandi-Security Security

              WKWebView has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              WKWebView code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              WKWebView is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              WKWebView releases are available to install and integrate.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of WKWebView
            Get all kandi verified functions for this library.

            WKWebView Key Features

            No Key Features are available at this moment for WKWebView.

            WKWebView Examples and Code Snippets

            No Code Snippets are available at this moment for WKWebView.

            Community Discussions

            QUESTION

            WKWebView - evaluate JavaScript without seeing changes
            Asked 2022-Jan-10 at 19:34

            In my SwiftUI App, i used a WKWebView to update some html tags from native side, using SwiftUI TextFields. To get the communication working, i am using the evaluateJavaScript() method to send data from native to webview.

            My code looks like this:

            ...

            ANSWER

            Answered 2022-Jan-10 at 19:34

            This looks like Apple's defect, because updateUIView is called, but evaluateJavaScript (internal JavaScript) generates exception, because bridge.onMessage is lost and not a function more.

            Here is found work-around - reset WebView on scene activation (app comes into foreground), as it recreated with current states the previous values are preserved. Tested with Xcode 13.2 / iOS 15.2

            Source https://stackoverflow.com/questions/70657494

            QUESTION

            Load url in WKWebView when notification is opened
            Asked 2021-Dec-15 at 16:32

            I'm sending push notification's with OneSignal, I'm receiving them fine. My problem is, is that when I click on the notification, I'd like it to open the notification url. I have the notificationUrl, but loading the url in my WKWebView is my problem. I am using SwiftUi App lifecycle, and not UiKit. So take in note that I don't have a ViewController.

            I've tried using UIApplication.shared.open(URL(string: notificationUrl)!) but this opens the link in the browser.

            Here's my notification opened handler in AppDelegate.

            ...

            ANSWER

            Answered 2021-Dec-15 at 16:32

            What worked for me, is to make the webview variable a global variable in the code. So in WebView.swift or your webview file, put the WKWebView variable on the outside of the struct and apply:

            Source https://stackoverflow.com/questions/68568090

            QUESTION

            How to download a blob URI using AlamoFire
            Asked 2021-Dec-14 at 19:59

            I am trying to work with a WKWebView in swift and currently have a download engine using AlamoFire. I have run into a site that uses the blob: url scheme to download items. Is there a way to download blob files using AlamoFire or WKWebView in general?

            My specific goal is to download the content from this blob URI to a file.

            I would appreciate any help. Thank you.

            All relevant code is attached below.

            Here's the URL I was having a problem with:

            ...

            ANSWER

            Answered 2021-Dec-14 at 19:59

            After a few days, I was able to figure out how to download a blob URL without WKDownloadDelegate. The following code builds upon this answer.

            A message handler needs to be created to respond to JS messages. I created this in the makeUIView function

            Source https://stackoverflow.com/questions/70312488

            QUESTION

            Download a server file generated via PHP for WKwebview (iOS)
            Asked 2021-Dec-02 at 15:54

            I have a php file on the server that generates a file to download when I access to it via any web browser, even with safari.

            ...

            ANSWER

            Answered 2021-Nov-15 at 19:39

            From iOS 14.5 you can use WKDownloadDelegate to download attached files in responses and can provide a destination url to save:

            Source https://stackoverflow.com/questions/69928519

            QUESTION

            How can I open external links in Swift webview?
            Asked 2021-Nov-18 at 18:20

            I am totally new to Swift and I just need a webview app of my website. Everything seems fine except the external links such as "tel", "mailto", or "whatsapp". When I click them, nothing happens. I have searched many related titles and tried many things but the links are still not working. The last thing I tried is below. Can anyone help?

            ...

            ANSWER

            Answered 2021-Nov-18 at 18:20

            Try intercepting requests on WKWebView implementing decidePolicyFor navigationAction :

            Source https://stackoverflow.com/questions/69987992

            QUESTION

            WKWebView Dark and Light Mode with dynamic URL in Swift 5
            Asked 2021-Nov-11 at 13:03

            I created WKWebView that doesn't have one url. User use this WKWebView as Safari means user can search anything on WKWebView. I am facing one issue when I change dark and light mode my web view will show me only white(Light) mode. My app is working on both mode all things working fine except WKWebView.

            Already search on SO not find any related question on this. how to use iOS 13 darkmode for wkwebview

            I refer this blog but it's static url so it will not help me out

            https://useyourloaf.com/blog/using-dynamic-type-with-web-views/

            Also checked opaque and background property but not working for me!

            IMPORTANT User can search anything like google.com, photos or any surfing etc.

            ...

            ANSWER

            Answered 2021-Nov-08 at 11:22

            You can use injecting CSS technic to add Light/Dark feature to your loaded web pages e.g:

            Source https://stackoverflow.com/questions/69830561

            QUESTION

            WKWebView not loading WhatsApp Web
            Asked 2021-Oct-20 at 11:29

            I have a macOS web browser made using SwiftUI and WebKitView that works well with most sites but some pages such as WhatsApp i get the following error message to upgrade to a newer version of safari.

            WebView

            ...

            ANSWER

            Answered 2021-Sep-21 at 13:27

            First of all you can use Safari Services instead of WKWebView, so you will be actually using a compatible browser.

            Otherwise, it depends how the site checks the browser it's loaded in.

            • The most primitive way to check the browser type and version, is to look at browser's user agent string. For cases like this, you may be able to surpass the check by setting a customUserAgent on WKWebView to whatever the site supports. It's a hack though, as your WKWebView pretends to be a different browser.

            • More sophisticated cases check not the actual browser, but the capabilities they need. For example the site may check if cookies, or local storage is enabled. In this case you should just enable the required capabilities on your WKWebView.

            • In third case, site tries to explicitly block embedding its content into WKWebView or WebView. In that case you have to respect the site owner wishes, and not try to embed the site.

            Which one is the case of WhatsApp, not quite sure. You will have to experiment I guess.

            Source https://stackoverflow.com/questions/69269223

            QUESTION

            Cordova iOS: Failed to load resource: The requested URL was not found on this server
            Asked 2021-Oct-01 at 00:19

            EDIT: While i was trying the same solutions that I already tried, I got it working with "cordova.file.documentsDirectory", it must be something that I missed last week

            ORIGINAL QUESTION:

            I'm building a Leaflet map app in Cordova 9.0.0 that needs to be able to download, unzip, delete unzip file and then access images from unzipped directory on mobile device for offline use.

            I'm using Cordova File, FileTransfer and Zip plugins and application works as expected on the Android device, but not on iOS(using cordova platform iOS 6.2.0).

            I've tested it on iPhone 5s(iOS 12.5.4) device, iPhone 8(iOS 14.5) simulator, iPhone 11(iOS 14.5) simulator in Xcode and I can successfully download, unzip, delete zip file and then access map tiles through cordova.file.tempDirectory+"name_of_unziped_directory/" or cordova.file.applicationStorageDirectory+'Documents/name_of_unziped_directory/'(documentsDirectory) or cordova.file.documentsDirectory+'name_of_unziped_directory/' while offline, but when it comes to testing it on iPhone 11(iOS 14.7.1) device I can download, unzip and delete the file but cannot access map tiles and I get error:

            Failed to load resource: The requested URL file:///private/var/mobile/Containers/Data/Application//tmp/unzip_directory/zoom/x_coord/y_coord/image.png was not found on this server

            I'm trying to access map tiles like this(in this case we are accessing through documentsDirectory, but It gives the same results if I change the path as I mentioned above):

            ...

            ANSWER

            Answered 2021-Aug-23 at 13:37

            I had the same problem with the new releases of ios. As far as I can remember window.WkWebView.convertFilePath([your file path]); isn't enough and I can't provide an exact solution but what I ended up doing was:

            Source https://stackoverflow.com/questions/68893157

            QUESTION

            Flutter - Block Webview Cookies in WKWebView
            Asked 2021-Sep-27 at 06:29

            Our flutter app uses webview to give users access to our online retail store. This retails store uses cookies.

            This hasn’t been a problem until this week. As of last week, Apple started rejecting our updates because the webview section of the app uses cookies.

            We would like to configure the webview widget to block all web cookies by default.

            We’re using the webview_flutter widget, which uses WKWebView for iOS under the hood.

            Is there a way to automatically block all web cookies via the webview?

            ...

            ANSWER

            Answered 2021-Sep-27 at 06:29

            There is a way to clear the cookies:

            Source https://stackoverflow.com/questions/69339637

            QUESTION

            Ionic App stopped working on IOS 15 (didfailprovisionalloadforframe)
            Asked 2021-Sep-24 at 12:03

            Right after the splash screen fades out, the app is stuck on a blank page leaving this error in the console (ProxyWeb::didFailProvisionalLoadForFrame)

            Note that the same app works perfectly on all previous IOS versions. I tried to change the webview plugin version, cordova-ios, and played around with angular build process but no luck.

            I suspect that the angular portion of the project does not initialize, cordova itself loads successfully but anything beyond that is just an empty blank screen.

            ...

            ANSWER

            Answered 2021-Sep-24 at 12:03

            Problem solved by a colleague, turned out a few providers (DatePipe, Location, Market, InAppBrowser) in app.component.ts and a router animation were causing the fuss.

            Source https://stackoverflow.com/questions/69282910

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install WKWebView

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/mbarnig/WKWebView.git

          • CLI

            gh repo clone mbarnig/WKWebView

          • sshUrl

            git@github.com:mbarnig/WKWebView.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular iOS Libraries

            swift

            by apple

            ionic-framework

            by ionic-team

            awesome-ios

            by vsouza

            fastlane

            by fastlane

            glide

            by bumptech

            Try Top Libraries by mbarnig

            cornerstoneArchiveImageLoader

            by mbarnigJavaScript

            RadioLogic

            by mbarnigJavaScript

            cornerstoneDicomParserUTF8

            by mbarnigJavaScript

            dumpDICOMDIRarchive

            by mbarnigJavaScript