WKWebView - iframe content is not loading in simulator/device - ios

I have a small app with WKWebView and HTML page in it. HTML page is loaded from http://localhost running on a small web server inside the iOS app.
The problem is... when I try to load content to the iframe in the page it won't load. Iframe is working when running the site in desktop web browser from any server (including server running in the iOS simulator or device). But in the WKWebView running in simulator or device content of the iframe is not shown. I can see the request from the WKWebView to the real url (my site with no iframe blocking headers and served over http or https).
Can't find anything about iframe content blocking when using WKWebView. JavaScript can do request to the same domain and load JSON data without any problem, but iframe won't show (or load?) content.
iframe code is like this and is inserted using JavaScript, but won't load even when I put this code directly to the html of the page.
<p><iframe src="https://example.com/wwVzepZ9ZXgSzVa4GA_sWw" width="320" height="50" class="feedAds" frameborder="1"></iframe></p>
Any help, please? I'm stuck with this for two days now.

SORRY... I'm stupid, stupid stupid...
The whole problem was a "typo" in server response header for the page to be loaded inside the iframe...
Content-Type: Content-Type: text/html; charset=utf-8
Double "Content-Type:" - (invalid http header). WKWebView will not return any error or call any error callback, but will also leave the iframe empty.

Related

everytime favicon loads, browser loading old one initially and then new one

In my rails app, I am managing two favicons based on a condition.
Below is the code in my application layout
- if <condition>
= favicon_link_tag "favicon1.ico"
- else
= favicon_link_tag "favicon2.ico"
Its working fine as per condition but when I switch from favicon1 to favicon2, on page load browser loading favicon1 initially and then loading favicon2, and same is happending whenever favicon is loading in browser.
Browser: Chrome
Version: 105.0.5195.102 (Official Build) (x86_64)
Browser is not sending two requests
Browser cache enabled, but even if I disable it, issue still occurs.
My suspicion is that, when I click on any link in my app, browser is requesting for favicon, until the response comes back, browser loads previous favicon and once the response comes back, loads the correct favicon.
Browser is not requesting favicon everytime when I click a link but it's calling randomly and requesting frequently on few links.
Is there a way to stop browser from requesting favicon unless it's a whole page load?

iOS App with Webview inspecting > find URL

I'm using an iPhone App that has some important information on it, but I also figured out that it uses a webview. And I'm not sure if it's safe; like; is it over https? What URL is being called?
Is there a way you can find out what Website is being called in the webview? Like you can do inspect element when using Safari from OSX with usb-connected iPhone.
UIWebview works for any url you call it with. If your site is https, the communication will be encrypted. Not all requests on UIWebView are not https. You can't inspect element from iPhone/iPad/Simulator. You can do it in web in the mobile view (by using useragent).

CrossDomain in UIWebview

Hey erveryone,
im currently working on an app which should contain an uiwebview to show a website with some reports (used a website because we want to show it also on android).
The data for the reports were loaded from another page by ajax with cross domain headers (Access-Control-Allow-Origin headers are set) and it worked fine in firefox, chrome and the other standard browsers.
It also worked on mobile safari.
But nevertheless this did not work in the uiwebview.
The uiwebview is loading and displaying the website but without the data.
The base part of the code is :
[self.webView loadRequest:[NSURLRequest requestWithURL:[APPCONTEXT.service reportGetWebPageURL]]]
Should i have to set any headers with the website request or is it perhaps not possible to load the data ?
Thanks for helping me with this issue
EDIT
[APPCONTEXT.service reportGetWebPageURL] // NSURL*
Cannot post images so this should help to understand the system.
UIWebView (Request to show Website1)--> Website1 (AJAX Request for data to show)--> Website2

Titanium webview iframe doesnt seem to store cookies

I am developing an app using Appcelerators Titanium. The app consists of a webview. The webview shows i local page, iframe.html, and this iframe's src is pointed to a remote page.
However, this doesn't work out as i expected since it doesn't seem like the remote page can't store cookies when wrapped in an iframe. It works great on desktop and other devices. This seems to be an issue exclusive to iOS. I need the iframe, and i need cookies. What can i do to solve this?

iPad and iframe cookies

I am developing a Facebook canvas application using the iframe method, because of existing infrastructure the session data is set in a cookie between each page request (including jQuery JSON requests) this all works fine in Safari, Firefox, Chrome and IE( with the P3P header being set) but not in MobileSafari on the iPad (iOS 4.2).
I've been watching the debug as each page is loaded and it seems the session isn't being passed through as each page loads.
Does anyone know what it takes to get MobileSafari accepting cookies inside an iframe?
Thanks in advance!
Callum
One of my friends used this and said it worked
http://anantgarg.com/2010/02/18/cross-domain-cookies-in-safari/
EDIT: updated link

Resources