[React-Native-Webview]How to listen urls load inside a webpage - react-native-webview

when we access a webpage, it loads .css, JS, JPEG files, how to listen to those files loading and get their URLs, headers and bodies

Related

How to store and retrieve static json and html files from CMS?

We already have a Hippo CMS hosted for loading static web pages. We would like to store static json and html pages in the same instance and be able to render it as is (Contenttype: application/json or text/html). Could you please guide me if that is possible in hippo CMS.
I believe the simplest solution is to upload the JSON files as content "Assets" (can do for PDF, json, CSS, JavaScript, etc)
Then the path to the file will look like http://localhost:8080/site/binaries/content/assets/my-project/my-file.json (or whatever path & filename it was uploaded to).
The Assets folder will set the mime-type and repeat that as the Content-Type header, such as Content-Type: application/json;charset=UTF-8

Remove the auto download of a URL that points to a google bucket

I have files stored on google cloud storage. Google provides me a URL to access this files, but when I access this URL the file is auto downloaded. I wish to know if it is possible to remove or don't allow this auto download when we access the file URL. ;)
The download feature is handled by the client.
Calling the URL for an object stored in a bucket will return the object in the body of the HTTP request, and the client will choose what to do with this data.
If you use a web browser, the choice of downloading or not a file is usually given by the header Content-Type. In general, there are some MIME types that will be displayed on the browser itself (according to Chrome help, videos, images, PDFs and web pages will be displayed directly on the browser), while others will download directly.
To modify the MIME type of the files stored in a bucket, you must change it's metadata, so the browser will behave in the way you want.

Rendering a web page by browsers

I typed "Rendering a web page by browsers" in google and I obtained the following link.
According to this description HTTP requests for every resource connected with one page are made via separated TCP socket. I always thought that only one TCP socket is established and all resources (images, CSS and JS files) are sent through this socket. If am not clear enough: You type www.example.com in address bar of the browser. Let's say the web page under this address has N pictures and M CSS and JS files. How many TCP socket are opened by browser? 1+N+M?
Yes HTTP is a stateless protocol. Every resource a page needs is downloaded sepperately by your browser. That is html, flash / silverlight etc, images, css, js and so on. To optimize load times it's recommended to merge all css and all js into one file to reduce the ammount if requests needed to load a page.

iPhone - Send contents of webview as mail

I'm composing my messages using images, text and audio files and finally showing the preview in Webview. Now, I want to send what ever it is showing in web view as mail. Even images and audio files must be sent so that end user has just to see the message with all images and aduio files as in original message.
Is it possible?
Send the actual HTML of the web page. Be sure to set the in the page, so any links in the page will be referenced relative to the original URL. There are upsides and downsides to this method:
UPSIDE: Small file will be sent - just the HTML of the base page
DOWNSIDE: Any images and sounds will not be sent in the message - and will have to be downloaded by the users email client from the original URL when the page is viewed. (Any web client that supports HTML content type will be able to do this.)
Don't forget to set the content (MIME) type of the email message to TEXT/HTML.

Just can't seem to fetch the mobile Gmail html, what is wrong?

I'm trying to cache the mobile Gmail webpage because UIWebView does not cache the content itself (mobile safari does, but not UIWebView).
I tried the methods listed here Reading HTML content from a UIWebView basically saving the html either directly from URLRequest or from UIWebView itself. When I try to put the html saved back into UIWebView it is not the same page!
This is the page that I want to save
alt text http://img39.imageshack.us/img39/5679/screenshot20090830at123.png
This is the page that the html saved will display
alt text http://img39.imageshack.us/img39/8734/screenshot20090830at122.png
If you're loading using loadData:MIMEType:textEncodingName:baseURL: make sure you're setting baseURL correctly - that way, the WebView will know where to look for relative stylesheets and so on.
Edit: For example, if I was saving this page, I'd set the base URL to Just can't seem to fetch the mobile Gmail html, what is wrong?.
That looks like the same page to me, but with different stylesheets attached. If you're just re-displaying identical HTML from your local server, the relative stylesheet paths in Google's HTML would no longer be correct. Also, any AJAX requests meant to run after the page loads would no longer work (both because the relative paths to the scripts would be wrong, and also because Cross-Site Scripting restrictions would prevent them from contacting Google).
Attempting to scrape content from an AJAX-enabled application is no small undertaking. You'd have to replicate a lot of GMail's functionality to truly reproduce the exact page Google presents.