views:

1066

answers:

4

I'm looking for something similar to the VB6 / .Net Winforms "Browser Control", that let's you show a browser inside your application. I don't want to just render a page, I want it to be a fully-functional browser, in which people can click links, will run Javascript, etc.

In essence, what I want is an IFrame, only that it runs inside a Flash app, or a Silverlight app.

The ultimate reason for this is that I want to defeat IFrame busters. I'm making a web app that lets you see other sites inside of it, and I'm running into a bunch of sites that have this code:

var t=top.location,w=window.location;if(t!=w) t.replace(w);

(that's from eBay BTW)

which essentially pops the user out of my site and into theirs. My hope is that by using a "browser control" of some sort, inside a plugin sandbox, "top", will be top for that browser control, and not for my site.

Of course, if you have any other ideas to achieve the same, they'll be more than welcome.


Edit: I've tried the Component One control suggested by Bill, but it didn't work for these purposes, because it's creating an IFrame outside of the SilverLight control, so it executes in the same context as the page hosting Silverlight, which is what I'm trying to avoid.

+1  A: 

I use the HTML control created by Component One. It has the limitation that the Silverlight object in the page should be set to windowless, but otherwise it works very well.

Bill
Just adding the URL for that, to have it handy: http://www.componentone.com/SuperProducts/HtmlHostSilverlight/Thank you, i'll look into this!
Daniel Magliola
Unfortunately, this control doesn't work for what I'm trying to do. It will create an IFrame in the HTML page that hosts the Silverlight control, and position it right on top of Silverlight (which is why the SL control needs to be windowless).I'm looking for something that creates something *like* an IFrame, but it **has** to live inside the SL context, thus isolating it from the website around it.
Daniel Magliola
+1  A: 

Northcode SWF Studio allows you to add browser window on the stage in Flash. I personally use SWF Studio as a third party SWF2EXE tool to extend the power of Flash projectors. It's quite stable and powerful. As far as browser control is concerned here is the example you can download and test if it serves your purpose. Check the Browser APT here.

Pradeep Kalugade
Thanks! I'll look into that!
Daniel Magliola
+1  A: 

We've not built a component to enable folks to do this but we're open to suggestions here. That being said, easiest solution is an iFrame, but word of caution in that when you overlay an iFrame over the the top of Silverlight we've seen customers experience perf issues as a result (mostly due to alpha transparency of the iframe etc).

This isn't isolated to Silverlight, Flash suffers the same issue as it has to do with browsers and rendering within the given operating system.

HTH.

Scott Barnes / Rich Platforms Product Manager / Microsoft.

Scott Barnes
I'm not sure how feasible this is... It may be completely idiotic... But an alternative would be to embed some lightweight HTML renderer's code inside the Silverlight runtime. I'm guessing WebKit is a good alternative because I understand it's lightweight, although I understand the political problem that means...
Daniel Magliola
Another option (which, again, may be technically impossible) would be to try to create some kind of instance of the host browser inside the plugin. This would of course require browser-specific code, and it may well be impossible to do, I don't really understand how "plugins" like Flash/Silverlight interact with their host browsers.
Daniel Magliola
The part that spooks me with this concept is having this kind of relationshipBrowser -> Plugin -> Browser.. as i wonder if folks would expect the Browsers Plugn which has a browser plugin within needs to then load a plugin..O.o
Scott Barnes
But this is a great feature Scott. This way you can leave all the UI rendering to flash and, like complex menus and all and then display the content using HTML. So it gives a lot of flexibility. Frankly, I was waiting for Silver light release to see if it supports this functionality and I was quite disappointed. It seems that even Adobe hasn't thought about its power yet. I have tried writing you many times, requesting this feature but you seemed too busy marketing it :) @Daniel: This was exactly what I was looking for...
Faiz
A: 

It's an old post but I'll add my tupence answer. I used the DivElements free control for Silverlight link text and it works quite nicely. It just positions the div accurately so that it looks like it's on top.

As for the other such controls, you've got to set the windowless property of the Silverlight container to true.

It works really well for me and I'm able to seemlessly have Google maps and the Acrobat plugin displayed side by side with my Silverlight application.

PS: because the component just adds a <div> to the page, you can't do stuff like having it load dynamically Javascript file like in the <header> tag.

PPS: when setting the HTML code "by hand", be sure to hook up on the DocumentReady or Loaded event before playing with the HTML DOM.

Hope that helps someone.

R4cOON
This is not what I'm looking for, according to your description. I'm looking for something that'll "host" the "browser" inside the plugin itself. If this adds the IFrame to the page that hosts the plugin, and positions things so that it'll look nice, it won't provide me the isolation from the "window" object that i'm looking for.
Daniel Magliola