wkwebview

Scroll not visible in WebView macOS

帅比萌擦擦* 提交于 2020-07-10 10:29:26
问题 Is it possible to make the scroll not visible in WebView for macOS? TO IMPLEMENT THE WEBVIEW I have a WebView from the library to the Storyboard I have the connection @IBOutlet weak var webView1: WKWebView! I have in the ViewController.swift: webView1.load(URLRequest(url: URL(string: "https:www.apple.com")!)) WHAT I HAVE TRIED I have tried many things but it could be helpful to comment: -The iOS solution do not work in macOS: webView1.scrollView.isScrollEnabled = false - There are some

Xcode: Load custom locally stored font for remote content in WKWebView

五迷三道 提交于 2020-07-10 06:55:06
问题 I'm using the newest version of Xcode and Swift . I have the following code to load an HTML string and use a custom font, I prior imported in Xcode: let html = """ <html> <body> <head> <style> @font-face { font-family: 'Blastimo'; src: local('Blastimo'), url('Blastimo.ttf') format('truetype'); } </style> </head> <h1 style="font-family:'Blastimo';font-size:50px;">This is my test!</h1> </body> </html> """ webView.loadHTMLString(html, baseURL: Bundle.main.resourceURL) The following code allows

Loading Microsoft Office documents in WKWebView

戏子无情 提交于 2020-07-09 16:31:41
问题 I have been using UIWebView to display Microsoft Office documents (Word, PowerPoint, Excel) in my application for a while but Apple has recently deprecated the UIWebView class. I am trying to switch to WKWebView but Word, Excel, and Powerpoint documents are not rendering properly in WKWebView. Using UIWebView to display an Excel document (worked great): let data: Data //data is assigned bytes of Excel file let webView = UIWebView() webView.load(data, mimeType: "application/vnd.openxmlformats

Loading Microsoft Office documents in WKWebView

a 夏天 提交于 2020-07-09 16:26:07
问题 I have been using UIWebView to display Microsoft Office documents (Word, PowerPoint, Excel) in my application for a while but Apple has recently deprecated the UIWebView class. I am trying to switch to WKWebView but Word, Excel, and Powerpoint documents are not rendering properly in WKWebView. Using UIWebView to display an Excel document (worked great): let data: Data //data is assigned bytes of Excel file let webView = UIWebView() webView.load(data, mimeType: "application/vnd.openxmlformats

Cocoa: Open the links with Target_blank in a new tabs? WKWebview

陌路散爱 提交于 2020-06-29 06:41:16
问题 I created a cocoa web browser application. I was testing out my browser and I couldn’t open the links with target_blank . So I found a question on stack overflow. I used that answer and tested it out and I could open the links. But, the links would open in the same web page. I want it to open in a new tab. So I found this web page that tells me how to add nswindow tabs to my application I added tabs to my cocoa browser. Here are the codes I added I used the code below to create tabs in my

What is suppressesIncrementalRendering doing?

妖精的绣舞 提交于 2020-06-29 04:08:17
问题 I'm using the newest version of Xcode and Swift . I was googling around to make my KWWebView even faster and found the following: webConfiguration.suppressesIncrementalRendering = true Documentation says the following: A Boolean value indicating whether the web view suppresses content rendering until it is fully loaded into memory. But what does this mean? Does it mean, the html doesn't not get rendered and shown as long as not all resources like images and javascript files are completely

What is suppressesIncrementalRendering doing?

China☆狼群 提交于 2020-06-29 04:08:07
问题 I'm using the newest version of Xcode and Swift . I was googling around to make my KWWebView even faster and found the following: webConfiguration.suppressesIncrementalRendering = true Documentation says the following: A Boolean value indicating whether the web view suppresses content rendering until it is fully loaded into memory. But what does this mean? Does it mean, the html doesn't not get rendered and shown as long as not all resources like images and javascript files are completely

ITMS-90809: Deprecated API Usage - existing app that use UIWebView are no longer accepted

瘦欲@ 提交于 2020-06-27 07:17:21
问题 ITMS-90809: Deprecated API Usage - Apple will no longer accept submissions of new apps that use UIWebView as of April 30, 2020 and app updates that use UIWebView as of December 2020. Instead, use WKWebView for improved security and reliability. I am trying to update an existing app, not a new app. Still I am not able to upload the app. I got this error via email: We identified one or more issues with a recent delivery for your app, "App Name" 20202.421.1 (6). Please correct the following

How to Copy Cookie to WKWebview in iOS?

百般思念 提交于 2020-06-27 06:16:32
问题 I don't know how/which cookies are coming from which website. Because of that, I can't set manually the cookie names. How can I get third party cookies to paste to a WKWebview ? Here is my code but no chance. My webview; public class CustomWebView : WebView { public static readonly BindableProperty UriProperty = BindableProperty.Create( propertyName: "Uri", returnType: typeof(Uri), declaringType: typeof(CustomWebView), defaultValue: default(string)); public string Uri { get { return (string

How to load CSS file by using URL in WKWebView

▼魔方 西西 提交于 2020-06-17 12:56:23
问题 I want to inject CSS by using URL link , Working Working below code, If I store CSS file in Bundle path of project, lazy var webView: WKWebView = { guard let path = Bundle.main.path(forResource: "style", ofType: "css") else { return WKWebView() } let cssString = try! String(contentsOfFile: path).components(separatedBy: .newlines).joined() let source = """ var style = document.createElement('style'); style.innerHTML = '\(cssString)'; document.head.appendChild(style); """ let preferences =