System.Windows.forms.WebBrowser (For error see screenshots)

See code below for opening a radio station from maxscript.

Problems have been attached as images. And the website I'm trying to open is: http://www.bbc.co.uk/radio/player/bbc_radio_one

I'm sure it's something to do with .ObjectForScripting but I'm not sure how to implement that.

rollout webbrowser_rollout "Radio" width:380 height:685
(
edittext edt_url "URL:" text:"http://www.bbc.co.uk/radio/player/bbc_radio_one"
dotNetControl wb "System.Windows.forms.WebBrowser" pos:[0,22] width:380 height:685
 
fn openURL urlString = (
wb.url = dotNetObject "System.Uri" urlString )
on edt_url entered txt do openURL txt
on webbrowser_rollout open do
(
--wb.ScriptErrorsSuppressed = true;
--wb.ObjectForScripting = true
openURL edt_url.text
wb.ScrollBarsEnabled = false;
wb.AllowNavigation = true;
)
)
createdialog webbrowser_rollout
AttachmentSize
script_error_1.jpg35.58 KB
script_error_2.jpg42.43 KB

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
3dwannab's picture

Thanks

Wow, 2 years ago I posted this. Thanks.

That worked but the BBC Radio1 player doesn't work.

It probably needs an OAuth to run the player from a webbroswer.

johnim's picture

add wb.ScriptErrorsSuppressed = true

add wb.ScriptErrorsSuppressed = true

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.