oracle-samples / xfc

A javascript library for Cross Frame Communication
Apache License 2.0
17 stars 24 forks source link

Fix has attribute error #44

Closed yusufali2205 closed 4 years ago

yusufali2205 commented 5 years ago

Summary

We need to add an additional check on the hasAttribute property on unload. This will check to make sure hasAttribute exists before we use it.

Additional Details

Closing the application which is embedding a page is throwing error: Object doesn't support property or method 'hasAttribute' On logging out this element it shows [object Object] image Which doesn't look like a page element. So we need to add a check in case the variable element is not an html element.

yusufali2205 commented 5 years ago

@mhemesath please review

mhemesath commented 5 years ago

On logging out this element it shows [object Object]

That's what IE logs out for complex object. Elements are objects. With that said, at this point I don't have time to investigate further, and I feel like this PR is just patching a different underlying problem. Based on the code, all objects we call that method on should be objects.

yusufali2205 commented 5 years ago

On logging out this element it shows [object Object]

That's what IE logs out for complex object. Elements are objects. With that said, at this point I don't have time to investigate further, and I feel like this PR is just patching a different underlying problem. Based on the code, all objects we call that method on should be objects.

On doing alert(document.activeElement) in IE, I see it logs HTMLBodyElement image

yusufali2205 commented 5 years ago

can we get this merged?

yusufali2205 commented 4 years ago

@NSLockhart @mhemesath can you merge this?

yusufali2205 commented 4 years ago

@NSLockhart @mhemesath hoping to get this change in our current release.