Inject/serve custom CSS in WP8 WebBrowser Control [duplicate] - webbrowser-control

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How to inject Javascript in the WP7 WebBrowser control?
I have a WebBrowser control in my MainPage.xaml serving an external web page.
<phone:WebBrowser
Name="TravelPlanner"
Source="http://URL-HERE.com"
IsScriptEnabled="True"/>
Is it possible for me to somehow inject or serve my own CSS (or JavaScript for that matter)?

Yes. By invoking WebBrowser.InvokeScript after WebBrowser.LoadCompleted you can execute arbitrary javascript code in a webbrowser control. Web apps can then use WebBrowser.ScriptNotify to talk back to C#.
See more # How to inject Javascript in the WP7 WebBrowser control?

Related

WebBrowser control in UWP (Windows 10) XAML

Can you tell me how can I provide a browser control in Windows 10 (WUP) XAML?
When I'm using WebControl I'm getting a compile error that says
WebBrowser is not supported in a Windows Universal project.
I have to show an "external" website, not a static HTML resource.
Universal Windows apps in Xaml use the Windows.UI.Xaml.Controls.WebView to display HTML content.
Xaml:
<WebView Source="http://stackoverflow.com" />
From code:
myWebView.Source = new Uri("http://stackoverflow.com");
From my experiences ,others then above you can go Package.app manifest changes the start page to the URL that you want .

Convert XUL application to web app

Is it possible to convert an existing XUL application to a pure web application without a complete rewrite? Are there any existing guides on doing this?
There is an existing project based on XUL / Mozilla Application Framework that I would like to see as a web application. But it seems that with FF4 this would no longer be possible.
You can use XUL Runner if you like to keep it like a desktop app or use the Ample SDK which supports XUL in HTML pages and it does a rendering using HTML and JavaScript.

Access webpage resources from WebBrowser

Is there a way or a workaround to access resources loaded by a page in a WebBrowser, either the Windows Forms WebBrowser or the Windows Phone WebBrowser (and/or WPF WebBrowser)?
I've always used the DocumentText property of WebBrowser for web crawling and automated tasks, but never knew if resources are actually accessible from code, just like when we use firebug or the Chrome console to retrieve some documents that have been fetched when loading a page.

Can a web browser control be embeded in a Metro XAML App with the full features of a Metro Web App?

Can you embed a IE web browser control in a C# XAML based Metro app on windows 8?
Also when doing so can the HTML/Javascript it it have the full featureset that a Windows 8 HTML app has,such as calling the WinRT apis?
There is a WebView control you can use to view websites or open html strings, but I believe to be able to communicate with the WinRT APIs you would need to relay the calls through the ScriptNotify events.

Encapsulating a web page inside a C#/XAML Metro app

In the msdn docs it says in an HTML/CSS/JS Metro app an iFrame can be added to the page and website content can be loaded from a 'web context'
I would prefer to work in C#/XAML for this Metro app and I would just like it to encapsulate a website.
What is the correct method for displaying a website within a XAML page? Is there an equivalent of an iFrame in XAML? Can it be made full screen?
You can use the WebView class to display HTML content in a XAML app.