I want to show a webpage without loading anything but the page itself. Not even CSS or JavaScript pages. I want the WebView to make only one web request - to get the page from the url I provide it. Nothing else.
Is there a way to achieve that?
Related
I have a WebView in UWP which is getting some html content (including javascript).
I need a way to track actions performed on the Webview content, for instance if the user has clicked a button I would like to know.
I know https://learn.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.webview.scriptnotify
but for this to work javascript has to call window.external.notify().
But the problem is that I don't own this content and it doesn't make sense to ask the owners to change their handler to publish this window.external.notify().
So, is there any way I can track all the user actions without modifiying the content?
I don't think you can accomplish what you're wanting to do with the UWP web viewer.
One alternative to consider is CefSharp which has a WPF implementation of Chromium.
It gives you a lot of hooks and handlers to intercept requests and do a lot of custom work on JavaScript that you don't control. I used it to build a WPF based help system and it allowed me to intercept links to PDFs and videos so that I could display them in special viewers.
There are many applications out there that are displaying html content using XAML controls rather than displaying a web browser. Does anyone know if there is control used for this? If no control is available, what's the best way to do this?
I found this article but that seems to be overkill... Or is it?
http://thewp7dev.wordpress.com/2012/03/05/html-textblock/
I would like to keep the exact format of a web page (i.e. text, images, formatting, etc...) but I'd like if possible at all not use the web browser.
I have a pivot that requires 4 websites to be displayed but it would seem very heavy to create 4 web browser, not to mention I'd like to add different touch functionality that I'm struggling to do using the web browser.
I'd appreciate any feedback.
Thanks
There is no XAML controls for windows phone, except WebBrowser Control (WebView in WP8.1), which can display HTML as it is.
Your article describes exactly what you have to do, to display HTML in some other XAML controls (RichTextBox for example).
You have to parse HTML to XAML format. You can use thrid party components for this (HTML agility Pack http://htmlagilitypack.codeplex.com/) or implement your own parsing.
Also, I don't think, that combining WebBrowser control with Pivot (or Panorama) is a good idea, because it just consumes to much memory and there could be problems with scrolling and touch interaction.
The simple path I think is to reconsider your navigation model and use webbrowser control to display HTML. Maybe you can provide one WebBrowser and 4 links on top to switch between souces.
I would like to download a webpage from tumblr, so I can scrub it from the images -
https://www.tumblr.com/tagged/otto_schmidt
However (once your logged in), the page continues to load images, as you scroll down further.
What's the best way to download the page in C# so you can scrub it?
You can you winform webbrowser control, fire document loading complete event.
Hope this help!
I need some advice on what route to go with.
I'm using the jquery plugin galleriffic (image gallery), and I want to add a few galleries for a number of subjects that the user can choose from using AJAX.
My questions:
Should I make one gallery and change the list content?
Or just put all the lists on the page and just "show" them when the subject is pressed by the user?
If changing the content of a list is the better way, should I use javascript to do that or use ASP.NET (c#)?
I should add that the content of a list holds a lot of images for each subject.
Any advice will be great -- I'm pretty much a beginner.
I'd go with multiple galleries that you can toggle using Javascript. You may want to have each of these inside an IFRAME in case gallerific cant handle multiple instances of itself. Then toggle the IFRAME on and off using buttons on the main page.
This is probably the quickest way to get you up and running with most re-usability, you'll get a chance to learn Javascript by the simple fact you'll be implementing gallerific with a .NET backend and have to custom-build the navigation, but wont have to go into the 'deep end' by trying to clean up and re-use the same gallery.
Basically, you load each gallery as the user clicks on it on the main page. Each IFRAME contains 1 gallery with all images for that gallery (unless you have hundreds in which case you want to use paging with 100 thumbnail images per page), all IFRAMES are running concurrently but only 1 is displayed.
Try getting 1 gallery up and running connected to your .NET backend first, then do the navigation later by passing a parameter into the IFRAME src as like this: mygallery.aspx?name=travel_pics.
I have a website where there is a lengthy list of items to display so I am using Pagination to make the load on server easier.
However, I am doing the pagination via Ajax so when the user clicks on Next Page or Previous Page linkbutton, the data repeater is refreshed with ajax.
This was working fine until, people started to click on the item and then click back, it takes them to the first page.
suppose you scan about 10 pages, by clicking on the "Next Page" button. The data changes, but the URL in the browser doesnt. And you think you found what you want so you click on it, the browser loads different page, and when you click back, the browser takes you to previous page but since the url did not change, you are back to page 1.
Currently, I have removed ajax so the url changes everytime, but I have seen several website re-write the url in browser when ajax even happens, and I was wondering if I could do the same.
Google search for url re-write digs up only seo routing stuff, nothing on what I actually want (i am sure i am not using the right words)
I was interested to know this problem, any clues or leads on this one?
thanks!
ps: several questions here were kind of close, but was either too complicated or too deviated. sorry if its a duplicate.
The only part of an URL that you can change in js, client-side, without forcing browser to reload whole page is an anchor part (http://domain/page#anchor - the part after # sign). This part is used by many js application (e.g. Google Picassa), also by silverlight to provide browser history support. You'd have to set an anchor part when navigating to another page of your data. When the page is loaded, just check the anchor part and load appropriate page. Also, you'd have to periodically check for changes - this will happen when user uses back/forward feature in his/her browser. (There could be an event that is fired when that happens, I just haven't found it)