Summary: | referencing a Window object returned from window.open() after new window is navigated to a new domain causes the script to halt | ||
---|---|---|---|
Product: | [Applications] konqueror | Reporter: | Oded Arbel <oded> |
Component: | khtml ecma | Assignee: | Konqueror Developers <konq-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Mandrake RPMs | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | test case |
Description
Oded Arbel
2004-02-17 10:50:47 UTC
Created attachment 4747 [details]
test case
Test case for the problem:
- click the button
- go to the newly opened window/tab and navigate to a URL in another domain
- go back to the original page and click the button again.
Expected behavior - the new window will be closed and reopened.
Current behavior - the script halts execution with an error.
Hmm. apparently the test case does not work anymore even for the simple case of clicking the button once and then again, because the first window is now 'bugs.kde.org' and the new window is '': khtml (jscript): WARNING: JavaScript: access denied for current frame 'bugs.kde.org' to frame '' it used to run on my local file system where the domain is always ''. Anyway - this just goes to prove my point: once you open a window to a URL which is not your domain, you lose all access to the returned window object. other browsers (Mozilla and IE come to mind) allow you to call some methods on the resulting window object. The lookup for the properties valueOf and toString fails when trying to "print" the window object. I fail to understand how as the isSafeScript() functions shouldn't really get into the way in this case. Fixed now for KDE 3.3.7. The valueOf() and toString() functions were not accessible across sites but should have been. They just return [object Window] but that was still vital for your if (popUpWin && ....) test. |