Jump to content
MarkRobbins

IE embedded border-radius not complying

Recommended Posts

MarkRobbins

I have IE 10 installed, so I assume the embedded is using the same.

If I make a test html doc that has a DIV with inline style of "border-radius:8px 8px 8px 8px;" this radius works if I browse the file with normal IE 10 --- but if I am embedding IE in a form and using _IEPropertySet($oIE, 'innerhtml', $html) with the exact same html that is in the file, the border-radius does not work.

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>

_IEErrorHandlerRegister()
Local $oIE = _IECreateEmbedded()

Global $thisfile="C:\batch\borg\TestCreeper.au3"
Global $logg="C:\$data\logs\TestCreeper-log.txt";
Global $timestamp=@YEAR&"."&@MON&"."&@MDAY&"."&@HOUR&"."&@MIN&"."&@SEC&"."&@MSEC


Global $f_w=800
Global $f_h=400

Global $hgui=GUICreate("Embedded Web control Test", $f_w, $f_h, _
        (@DesktopWidth - $f_w) / 2, (@DesktopHeight - $f_h) / 2, _
        $WS_POPUP)
GUICtrlCreateObj($oIE, -2, -2, $f_w+30, $f_h+8)

GUISetState() ;Show GUI

_IENavigate($oIE, "about:blank")
Global $st='body {  background-color:black;margin: 0; padding: 0; } '

Global $tx='Mary had a little lamb, little lamb, little lamb, little lamb, whose fleece was white as snow'


;THIS DOESNT WORK, SPECIFYING EACH INDIVIDUALLY
Global $br=BorderRadiusTxt(8)
;MsgBox(0,$thisfile,$br)

;NONE OF THE FOLLOWING WORK
$br='border-radius:8px;'
$br='-ms-border-radius:8px;'
$br='-webkit-border-radius:8px;'
$br='-moz-border-radius:8px;'

$br='border-radius:8px 8px 8px 8px;'
$br='-ms-border-radius:8px 8px 8px 8px;'
$br='-webkit-border-radius:8px 8px 8px 8px;'
$br='-moz-border-radius:8px 8px 8px 8px;'

;WORKS IN IE, BUT NOT IN EMBEDDED     <<<<<=== HERE
$br='border-radius:8px 8px 8px 8px;'

Global $t='';
$t&='<div style="position:absolute;'&$br&'border:1px solid green;background-color:black;padding:12px;color:#ccc;font-family:Tahoma;height:10px;top:10px;left:10px;">'

$t&=$tx
$t&='</div>'

Global $body_tags='border="0" marginheight="0" topmargin="0" vspace="0" marginwidth="0" leftmargin="0" hspace="0" '

Global $html='<HTML><HEAD><STYLE type="text/css">'&$st&'</STYLE></HEAD><BODY '&$body_tags&'>'&$t&'</BODY></HTML>'
;MsgBox(0,$thisfile,$html)
;ClipPut($html)

Global $r=_IEPropertySet($oIE,'innerhtml',$html)

; Waiting for user to close the window
While 1
    Local $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
    EndSelect
WEnd

GUIDelete()









Func BorderRadiusTxt($i)
  Return 'border-top-left-radius:'&$i&'px;' & _
  'border-top-right-radius:'&$i&'px;' & _
  'border-bottom-left-radius:'&$i&'px;' & _
  'border-bottom-right-radius:'&$i&'px'
EndFunc

;;;;;;functions
Func ts()
  Return @YEAR&"."&@MON&"."&@MDAY&"."&@HOUR&"."&@MIN&"."&@SEC&"."&@MSEC
EndFunc
Func logline($line)
  Local $fh1=FileOpen($logg,1);
  If $fh1<>-1 Then
    FileWriteLine($fh1,$line)
    FileClose($fh1)
  EndIf
EndFunc

Share this post


Link to post
Share on other sites
cu0x

I have IE 10 installed, so I assume the embedded is using the same.

If I make a test html doc that has a DIV with inline style of "border-radius:8px 8px 8px 8px;" this radius works if I browse the file with normal IE 10 --- but if I am embedding IE in a form and using _IEPropertySet($oIE, 'innerhtml', $html) with the exact same html that is in the file, the border-radius does not work.

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>

_IEErrorHandlerRegister()
Local $oIE = _IECreateEmbedded()

Global $thisfile="C:\batch\borg\TestCreeper.au3"
Global $logg="C:\$data\logs\TestCreeper-log.txt";
Global $timestamp=@YEAR&"."&@MON&"."&@MDAY&"."&@HOUR&"."&@MIN&"."&@SEC&"."&@MSEC


Global $f_w=800
Global $f_h=400

Global $hgui=GUICreate("Embedded Web control Test", $f_w, $f_h, _
        (@DesktopWidth - $f_w) / 2, (@DesktopHeight - $f_h) / 2, _
        $WS_POPUP)
GUICtrlCreateObj($oIE, -2, -2, $f_w+30, $f_h+8)

GUISetState() ;Show GUI

_IENavigate($oIE, "about:blank")
Global $st='body {  background-color:black;margin: 0; padding: 0; } '

Global $tx='Mary had a little lamb, little lamb, little lamb, little lamb, whose fleece was white as snow'


;THIS DOESNT WORK, SPECIFYING EACH INDIVIDUALLY
Global $br=BorderRadiusTxt(8)
;MsgBox(0,$thisfile,$br)

;NONE OF THE FOLLOWING WORK
$br='border-radius:8px;'
$br='-ms-border-radius:8px;'
$br='-webkit-border-radius:8px;'
$br='-moz-border-radius:8px;'

$br='border-radius:8px 8px 8px 8px;'
$br='-ms-border-radius:8px 8px 8px 8px;'
$br='-webkit-border-radius:8px 8px 8px 8px;'
$br='-moz-border-radius:8px 8px 8px 8px;'

;WORKS IN IE, BUT NOT IN EMBEDDED     <<<<<=== HERE
$br='border-radius:8px 8px 8px 8px;'

Global $t='';
$t&='<div style="position:absolute;'&$br&'border:1px solid green;background-color:black;padding:12px;color:#ccc;font-family:Tahoma;height:10px;top:10px;left:10px;">'

$t&=$tx
$t&='</div>'

Global $body_tags='border="0" marginheight="0" topmargin="0" vspace="0" marginwidth="0" leftmargin="0" hspace="0" '

Global $html='<HTML><HEAD><STYLE type="text/css">'&$st&'</STYLE></HEAD><BODY '&$body_tags&'>'&$t&'</BODY></HTML>'
;MsgBox(0,$thisfile,$html)
;ClipPut($html)

Global $r=_IEPropertySet($oIE,'innerhtml',$html)

; Waiting for user to close the window
While 1
    Local $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
    EndSelect
WEnd

GUIDelete()









Func BorderRadiusTxt($i)
  Return 'border-top-left-radius:'&$i&'px;' & _
  'border-top-right-radius:'&$i&'px;' & _
  'border-bottom-left-radius:'&$i&'px;' & _
  'border-bottom-right-radius:'&$i&'px'
EndFunc

;;;;;;functions
Func ts()
  Return @YEAR&"."&@MON&"."&@MDAY&"."&@HOUR&"."&@MIN&"."&@SEC&"."&@MSEC
EndFunc
Func logline($line)
  Local $fh1=FileOpen($logg,1);
  If $fh1<>-1 Then
    FileWriteLine($fh1,$line)
    FileClose($fh1)
  EndIf
EndFunc

Did u solve the problem? I'm facing the same issue...

Share this post


Link to post
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

  • Similar Content

    • FMS
      By FMS
      Hello,
      I try to get all the text from a news site around a subject.
      The first run I get all the text inside a attribute in an array.
      When i try to go back and reload another page it chrashes and think it because "$oIE.GoBack"
      I couldn't find anything in the help/forum around this subject.
      Do I need to reload the $oIE or something afther an X.GoBack?
      The error i got is :
      if $oTag2.GetAttribute("class") == "NewsDetail" Then if $oTag2^ ERROR I'm not shure why I got this error, maybe someone could explain?
      Also I'm open for some pointers in this test script because I'm pretty new in working whit the IE.UDF
      Maybe there is an simpler way to get the same results?

      test script:
      #include <IE.au3> #include <MsgBoxConstants.au3> #include <Array.au3> HotKeySet("{ESC}", "Terminate") Global $oIE = _IECreate("https://www.iex.nl/Zoeken/Nieuws.aspx?q=air%20france") ;get first subject Global $oLink1 = _IEGetObjById($oIE, "ctl00_ctl00_Content_LeftContent_NewsSearch_repNews_ctl00_linkNews") Sleep(500) _IEAction($oLink1, "click") Sleep(500) Global $oTags = _IETagNameGetCollection($oIE, "div") Global $aResults[1] For $oTag In $oTags if $oTag.GetAttribute("class") == "NewsDetail" Then _ArrayAdd($aResults, $oTag.innerTEXT) EndIf Next $aResults[0] = UBound($aResults) - 1 _ArrayDisplay($aResults, "Episodelist") ConsoleWrite($aResults[1] & @CRLF) $oIE.GoBack ;get second subject Global $oLink2 = _IEGetObjById($oIE, "ctl00_ctl00_Content_LeftContent_NewsSearch_repNews_ctl01_linkNews") Sleep(500) _IEAction($oLink2, "click") Sleep(500) Local $oTags2 = _IETagNameGetCollection($oIE, "div") Local $aResults2[1] For $oTag2 In $oTags2 if $oTag2.GetAttribute("class") == "NewsDetail" Then _ArrayAdd($aResults2, $oTag2.innerTEXT) EndIf Next $aResults2[0] = UBound($aResults2) - 1 ConsoleWrite($aResults2[1] & @CRLF) Func Terminate() _IEQuit($oIE) Exit EndFunc ;==>Terminate  
    • SkysLastChance
      By SkysLastChance
      I am having a hard time understanding why this is not working. I was hoping some one could help explain it to me. 
      $tags = $oIE.document.GetElementsByTagName("input") For $tag in $tags $class_value = $tag.GetAttribute("class") If string($class_value) = "fTs-p3298-l0 wplEditControl" Then $target = $tag ExitLoop EndIF Next MsgBox(0,"",$target) If $target = "fTs-p3298-l0 wplEditControl" THEN MsgBox(0,"","itworked") I have tried 
       MsgBox(0,"",$target.Attribute)  MsgBox(0,"",$target.Value)  MsgBox(0,"",$target.InnerText) I would expect to see this in the msgbox
      fTs-p3298-l0 wplEditControl  
    • SkysLastChance
      By SkysLastChance
      I am trying to grab the id "in2xk_26" however it the characters before the underscore always change. (in the name too)
      Is there a way I can find a id or name by the last 3 charcters?
      Using something like "stringright?"
      So I would want to search for just "_26" in this case.
      This is assuming that there are no other _26
       

      #include <Excel.au3> #include <IE.au3> #include <GUIConstantsEx.au3> Global $iMousespeed = 25,$target = "",$TagName = "",$Value = "",$Atrribute = "" $oIE = _IEAttach("MEDITECH") $TagName = "input" $Value = "in2xk_26" $Attribute = "id" $tags = $oIE.document.GetElementsByTagName($TagName) ;TagName ------ MAKE SURE TO NAME THESE For $tag in $tags $class_value = $tag.GetAttribute($Attribute) ;Attribute ------ MAKE SURE TO NAME THESE If string($class_value) = $Value Then ;Value ------ MAKE SURE TO NAME THESE $target = $tag $iScreenX = _IEPropertyGet($target, "screenx") $iScreenY = _IEPropertyGet($target, "screeny") $iWidth = _IEPropertyGet($target, "width") $iHeight = _IEPropertyGet($target, "height") $oMouseCords = MouseMove($iScreenX + $iWidth / 2, $iScreenY + $iHeight / 2, $iMousespeed) MouseClick($MOUSE_CLICK_LEFT) ExitLoop EndIf Next  
       
    • SkysLastChance
      By SkysLastChance
      I was wondering how I read data inside of a iframe. I would like to be able to click something inside a iframe. However, I can't even find the tag. 
      The id and name change all the time so I can't use those. 
      The code highlighted in blue is what I am trying to click. (second picture)
      Here is what I have tried.
      $target = "" $tags = $oIE.document.GetElementsByTagName("div") For $tag in $tags $class_value = $tag.GetAttribute("class") If string($class_value) = "s_92 altstyle s_93 s_94" Then $target = $tag ConsoleWrite("Tag Found " & $target.outerText&@CRLF) ExitLoop EndIf Next  

       
       

    • SkysLastChance
      By SkysLastChance
       
      WinActivate("MEDITECH - Internet Explorer") Sleep (500) $oIE = _IEAttach("MEDITECH") $oDiv1 = _IEGetObjById($oIE, "sysmenu-searchbarbutton") _IEAction($oDiv1, "click") I am just trying to click the little magnifying glass, next to the gear button with no luck. I was hoping someone might have an idea why this is not working?
       

×