开发者

Browser inside of a browser

I am not trying to track clicks or anything like other people - I just want to put a browser within a browser that can go back,开发者_如何学运维 forward, refresh, accept user-entered URLs, and store bookmarks. Can flash/silverlight/ajax/whatever do this? If so, how?


How about:

Solution 1:

  1. Create or use an existing ActiveX Web Browser control.
  2. And let your web/page host that ActiveX, or host multiple controls.

Solution 2:

  1. Put an iframe inside a UserControl, a textbox and a go button.
  2. Get the user provided url from textbox.
  3. Change the src of the iframe when user clicks the go button.

_

<iframe id="iFrame" name="myFrame" src="http://bing.com" 
                                     width="100%" height="300" frameborder="0">
<p>Does your browser support iframes?</p>
</iframe>

--EDIT--

This is in response to your comment; you posed 3 questions:

For 1, thats correct, ActiveX works for IE, more specifically for Windows; there are ways you can install ActiveX for different browsers, but it(the ActiveX) would require windows OS. See this.

For 2, try handling that using JavaScript; something like following within iframe block.

<p><a href="javascript:history.back()">Back</a></p>

Checkout these examples.

For the third one, if I understand you correctly then you can always parse the url when user clicks onto the Go button; and respond accordingly before rendering the page.


flash can do basic html (AFAIK) not sure about silverlight. you will struggle to do it with javascript/iframes. Especially back/forward/refresh buttons. If you are on the same domain you have some control over the iframe, but once it leaves your domain, you lose control


Would using an iframe or an object with type="text/html" be useful to you in terms of being able to embed a page within a page? Either method effectively permits loading a separate page within a page with little side-effect.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜