Forum Discussion
Actually, I think the difference is beyond even just whether or not it shows as RGB versus Hex... I have a checkpoint set up that does something similar.... but the caveat that I have is that it will work with IE only. I think the contentDocument property/object or some of the methods and properties of it are only available in IE. That would be where I'd start, to put a breakpoint on that line and do some investigation as to why JavaScript is burping there...
Thanks Robert!
You are always there when I need help! I almost gave up hope. I will give it a try tomorrow and let you know.
Dave
- royd6 years agoRegular Contributor
Hi Robert,
As you suggested, I am using IE 11. Now I am getting runtime error:
JavaScript runtime error.
TypeError: Cannot read property 'color' of nullIf you take a look at the above screenshot, the style (color) in named 'backgroud-color'. I am using the following to Log the color:var style = page.contentDocument.defaultView.getComputedStyle(colorPrimary, ""); Log.Message(style.background-color);
I am not quite sure if I should be using
Log.Message(style.background-color);orLog.Message(style.color);Either way, I am getting the same error.Thank you.- tristaanogre6 years agoEsteemed Contributor
In the code that I'm using, I get the element from the page in IE... then I get the "currentStyle.backgroundColor" property. I think that's better than the getComputedStyle method. See if that works better for you.
- royd6 years agoRegular Contributor
Thank you. I will give it a try.
- royd6 years agoRegular Contributor
I used:
var style = page.contentDocument.defaultView.currentStyle.backgroundColor(colorPrimary, "")
as you suggested.
I am getting:
JavaScript runtime error.
TypeError: Cannot read property 'backgroundColor' of undefined- tristaanogre6 years agoEsteemed Contributor
backgroundColor is not a method, it's the actual property. So, just compare that property to the desired value.
Related Content
- 11 years ago
Recent Discussions
- 23 hours ago