Windows 7 phone cannot display locally stored HTML file in browser - windows-phone-7

I'm using the embedded web browser, and it (the browser) works fine. Can I display a locally stored HTML file in it? The file is in folder 'html'. I am trying it but it does not work - says it cannot find the web page.
My code:
<phone:WebBrowser Name="webBrowser1" Height="467" Source="/html/test.html"/>

To display static content in a browser control, you can "use a WebBrowser control to display static web content that an application has saved into isolated storage using the SaveToString() method".
See: http://msdn.microsoft.com/en-us/library/ff431811(v=vs.92).aspx
Hope this helps you.

Related

localhost API image not showing on browser

As i'm developing a Web API for angular application i have saved the image in my Web Api project and the project folder structure is below.
Now as i'm trying to get access for the image via browser it doesn't show the image here is a snapshot for it below.
I have tried calling the HTML page of angular like this below.
<img src="http://localhost:4000/Uploads/Profile/057f4ed8-5b52-4ba0-b3ec-ae3b4f4e9baa.jpg" class="img-fluid">
It doesn't work how can i access these images in my other project and also the Web API project is running.
To Enable Static Content go to Window Features then iis

Making content accessible on Addon SDK

I am developing an addon using Firefox's Addon SDK (v. 1.11). My extension dynamically creates an iframe on each website and then loads an html file which includes other resources such as images, font files, etc. from the add on's local directory.
Problem
When loading any of such local resources (i.e.: "resource://" schema), the iframe fails to display them and a message is thrown:
Security Error: Content at http: //www.XXX may not load or link to
resource://XXX
This is a security measure introduced on Firefox 3. When developing without the Addon SDK, the way around it is declaring a directory with "contentaccessible=yes", making the directory's contents accessible to anyone, including my add on. However, I have not been able to find similar functionality using the Addon SDK. Is there a better way of using local data on an iframe that my addon creates and inserts into a page?
I don't think you can directly load an iFrame that points to a resource inside your URL. The browser complains because it's either breaking same origin policy or cross site scripting one. I can't remember which one right now.
if it is html content you want to load you can always inject it into the DOM and then send a message to the document object using the events API to display your custom html. I've done this in the past and it works.
so from main.js send a message to content script which will then inject your iframe html into the DOM and then you can send the document object a message to display it.
I hope this helps.
Not sure if this was the case when you posted the question, but it appears that "resource://" should no longer be used with the Addon SDK.
If you're using the resource inside of an HTML file in the extension, you can reference it locally, otherwise you should use data.url('whatever.jpg') and pass around that value as needed.
Full info is here: http://blog.mozilla.org/addons/2012/01/11/sdk-1-4-known-issue-with-hard-coding-resource-uris/

Launch IE from app passing HTML content

I need to launch IE from my WP7 app and load the HTML to create the page dynamically. The HTML is read from a web service and can change at any time, so I'm not able to just store the HTML in a file. Is there a way to do this -- much like you do with WebBrowser.NavigateToString(strHtml)?
-Thanks!
If you are attempting to open your HTML content in an embedded WebBrowser control you can use the "NavigateToString" function and pass it the HTML content you would like to load.
If you are trying to open it in the native IE browser on the device then I would recommend putting state information in the URL and opening the page directly with any parameters required to replicate the view in the browser via the WebBrowserTask. This way you wouldn't technically be opening the HTML code from your app but you would be able to ensure that the HTML content loaded from your service is correct based on your query parameters.
Are you looking for WebBrowserTask?

Windows Phone 7 Web Browser Only Load HTML

Hi i'm using the webbrowser control to download a html webpage. I only need the code, however the webbrowser is also downloading all the extra css/javascript/images linked to from the webpage, which is using up time and bandwidth. So is there a way to make the web browser only download the webpage and nothing else? I have to use this webbrowser because it's logged in to the site, so unfortunately a webclient would not work.
Thanks,
ng93
How is it logged into the site? Could you use GetCookies() API on the browser control and add that to the HttpWebRequest?

Load HTML in Firefox Extension

I want to create a Firefox Extension which will display a webpage. It will be like user should write a something in browser like "about:" or even a button would do ?
How can i load the WebPage in Firefox. The user should have a feel that a webpage is being loaded.
PS: I have javascript and CSS in that Page.
If i cannot make then what changes do i need to make in the web page for that change.
I also want to connect to a server and fetch XML data and want to display process that data and and display it on the page. I am developing this extension as my page is static and HTML/Javascript does not allow cross domain queries. I hope that cross-domain queries are possible if i use extension.
There is Browser XUL object that acts a an standalone browser. You can load any document inside that.

Resources