Jump to content

How do I unblock a clientside javascript popup


Recommended Posts

Im using ie.au3 to run a client-side web page in a embedded browser in a gui.

the web page has dialog boxes links.....the linked dialog boxes contain javascript and when they open the active-x security warning is diplayed under the address bar.

How can i suppress the active-x warnings?

The web page i'm running is a wysiwyg editor, the pop-up dialog box's are color pickers/insert tables..... etc..

I could change the popups to modal types but it would be heaps of changes to the javascript so hoping there is a workaround.....

cheers

Link to comment
Share on other sites

Can you create a small reproducer (see my sig) to test with?

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

Can you create a small reproducer (see my sig) to test with?

Dale

can't think of a small basic example right now.

wysiwyg editor embedded from : openWysiwyg

selecting table or forecolor opens a dialog popup because it running client side gives the security warning.

#include <GUIConstants.au3>
#include <IE.au3>
;#include "test2.au3"


_IEErrorHandlerRegister ()

$oIE = _IECreateEmbedded ()
GUICreate("Embedded Web control Test", 640, 580, _
        (@DesktopWidth - 640) / 2, (@DesktopHeight - 580) / 2, _
        $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)
$GUIActiveX = GUICtrlCreateObj($oIE, 10, 40, 500, 365)


GUISetState()       ;Show GUI
;_IEPropertySet ($oIE, "scrolling", "no")



_IENavigate ($oIE, "C:\Program Files\AutoIt3\beta\Will\openwysiwygv1.4.6cWill\exampleWill.html")
;_IENavigate ($oIE, "about:blank")
;_IEDocWriteHTML ($oIE, $temp)

_IEAction ($oIE, "refresh")
$oIE.document.body.scroll="no"
; Waiting for user to close the window
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        
    EndSelect
WEnd

GUIDelete()

Exit
Link to comment
Share on other sites

can't think of a small basic example right now.

OK, when you do I'll be glad to see what I can do to help.

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

OK, when you do I'll be glad to see what I can do to help.

Dale

Not sure why an example is required unless the question is being misunderstood.

Whenever IE opens any file running from your hard drive that contains script of any type it will throw up the activex security warning:

html:

<html>
<head>
</head>
<body>
<script type="text/javascript">
//
</script>
</body>
</html>

if this page was embedded in a gui there is no warning...

If a page embedded in a gui needs to open a popup and the popup contains scripting........how to suppress the security warning?

Link to comment
Share on other sites

The example is required so that the question is not misunderstood.

When I open your HTML above in IE I get no warning.

Please take a moment to provide more detailed steps so that there is no question about what you are trying to fix.

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

When I open your HTML above in IE I get no warning.

Interesting, i'm using IE7 with all settings set to IE's defaults.

When any html file from my HD that contains scripting (javascript etc) is opened with IE the warning is displayed:

"To help protect your security, Internet Explorer stopped this site from installing an ActiveX control on your computer. Click here for options"

If your not getting that warning your "Automatic prompting for ActiveX controls" setting is disabled.....

IE7's help file:

Can I turn off the Information bar?

Yes, you can, but we don't recommend it. If you do want to turn it off, you have to turn it off for each type of message.

Link to comment
Share on other sites

Example scripts

embed.html

<html>

<head>

</head>

<body width=150 height=200>

<script type="text/javascript">

//

</script>

I'm a <a href="popup.html" target="new">popup opener</a>

</body>

</html>

#include <GUIConstants.au3>
#include <IE.au3>
_IEErrorHandlerRegister ()
$oIE = _IECreateEmbedded ()
GUICreate("Embedded Web control Test", 640, 580, _
        (@DesktopWidth - 640) / 2, (@DesktopHeight - 580) / 2, _
        $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)
$GUIActiveX = GUICtrlCreateObj($oIE, 10, 40, 600, 360)
$GUI_Button_Back = GUICtrlCreateButton("Back", 10, 420, 100, 30)

$GUI_Button_Stop = GUICtrlCreateButton("Popup", 340, 420, 100, 30)

GUISetState()       ;Show GUI

_IENavigate ($oIE, @ScriptDir & "\embed.html")

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        
        Case $msg = $GUI_Button_Back
            _IEAction ($oIE, "back")
        
        Case $msg = $GUI_Button_Stop
            _IENavigate ($oIE, @ScriptDir & "\popup.html")
           
    EndSelect
WEnd

GUIDelete()

Exit

func popup()
    
EndFunc

popup.html

<html>

<head>

</head>

<body width=150 height=100>

<script type="text/javascript">

//

</script>

I'm a popup

</body>

</html>

Cheers

Edited by Will66
Link to comment
Share on other sites

Thanks, now it is clear what you are seeing. I have "Allow active content to run in files on My Computer" selected in advanced Internet Options. When I disable that and simply open popup.html in a browser I get the information bar as you describe (no need for the GUI).

I think that the easy way to avoid the information bar from appearing would simply be to change the filename of popup.html to "popup.hta". HyperText Application files run in a different security context.

The other way to deal with it would be to manipulate the information bar once it appears. It is actually a Win32 control and can be accessed with standard AutoIt Win* and Control* functions.

The control has these characteristics:

Control ID: 37425

ClassNameNN: Button1

It is easy enough to click on it, but that creates a popup context menu where the desired element is "Allow Blocked Content...". I do not know how to select options on this menu but it is likely that others do.

I suggest you repost and reformulate your question as strictly a question about selecting an option from a popup context menu, giving popup.html and the information about the control and the option you want to select and see if you can get the answer.

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...