Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

IFRAME in Opera & Security error fix #130

Merged
merged 1 commit into from

4 participants

Sergey Bogdanov asyncerror Fedor Tyurin Rostislav Hristov
Sergey Bogdanov

Opera forbids accessing top.document properties such as "title" or event "onhashchanged" from IFRAME and throws error "Uncaught exception: ReferenceError: Security error: attempted to read protected variable: onhashchange." Since _window method only checks for top.document property I suggest to add top.document.title check either - exception will be thrown and code will return reference to window instead of top.

Sergey Bogdanov desunit Workaround for Opera error: "Uncaught exception: ReferenceError: Secu…
…rity

error: attempted to read protected variable: onhashchange" occurred in
iframe
4f695ea
asyncerror

Works! Thank you!

Fedor Tyurin

Works perfectly. Thank you so much!

Rostislav Hristov asual merged commit 38b3ac0 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 9, 2012
  1. Sergey Bogdanov

    Workaround for Opera error: "Uncaught exception: ReferenceError: Secu…

    desunit authored
    …rity
    
    error: attempted to read protected variable: onhashchange" occurred in
    iframe
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  src/jquery.address.js
2  src/jquery.address.js
View
@@ -60,7 +60,7 @@
},
_window = function() {
try {
- return top.document !== UNDEFINED ? top : window;
+ return top.document !== UNDEFINED && top.document.title !== UNDEFINED ? top : window;
} catch (e) {
return window;
}
Something went wrong with that request. Please try again.