Ticket #2115 (closed Bug: fixed)
Permission denied to get property window.OnUploadCompleted
| Reported by: | wwalc | Owned by: | wwalc |
|---|---|---|---|
| Priority: | High | Milestone: | FCKeditor 2.6.1 |
| Component: | File Browser | Version: | FCKeditor 2.6 |
| Keywords: | Confirmed | Cc: |
Description
Source: http://www.fckeditor.net/forums/viewtopic.php?f=6&t=9242
I use FCkeditor 2.6Rc in Ubuntu FIrefox 2.0.0.13, when i upload a image file, i get error message in browser error console "Error: uncaught exception: Permission denied to get property Window.OnUploadCompleted",
but when checked the upload dir in my server, the image has been actually uploaded successfully.
Attachments
Change History
comment:1 Changed 4 years ago by wwalc
- Keywords Confirmed added
- Owner set to wwalc
- Priority changed from Normal to High
- Milestone set to FCKeditor 2.6.1
comment:2 Changed 4 years ago by wwalc
- Keywords Review? added
Comment: since we will call window.parent.OnUploadCompleted anyway, let's use it to test if we can access a parent property.
comment:3 Changed 4 years ago by alfonsoml
- Keywords Review- added; Review? removed
I haven't tested the patch, but I think that instead of keeping all that javascript, the code provided in [1799] should be used (I mean, a minimized version), and update that file to reflect the adjustment.
comment:5 Changed 4 years ago by fredck
- Keywords Review- added; Review? removed
The only fault for me is that it is checking for window.parent.OnUploadCompleted in _dev/domain_fix_template.js, which should be a quite generic code instead.
I think the original problem is that we were using window.top.opener... so maybe checking "window.parent.document.domain" should work in the same way as "window.parent.OnUploadCompleted", but without impacting on the code generality.
I'm reviewing- it just to check this approach, otherwise everything sounds good.
comment:6 Changed 4 years ago by fredck
- Summary changed from Ubuntu - Permission denied to get property Window.OnUploadCompleted to Permission denied to get property window.OnUploadCompleted
Removing "Ubuntu" from the subject, as it seems this one is impacting all browsers and installations as of FCKeditor 2.6.
comment:7 Changed 4 years ago by wwalc
- Keywords Review? added; Review- removed
The patched added above does the same thing as the previous one, but uses "window.parent.document.domain" in a loop to detect the correct domain.
There is another thing that is fixed in this patch. #1919 broke one thing. It seems that is impossible to use the standalone file browser, if we open it in the new window in Firefox (worked fine until 2.6 beta). Also the domain relaxation itself is broken in Firefox. To check this, simply open file browser:
http://dev.fckeditor.local/fckeditorsvn/editor/filemanager/browser/default/browser.html?Type=Image&Connector=/fckeditorsvn/editor/filemanager/connectors/php/connector.php
note that if you change the name of a domain from dev.fckeditor.net to localhost, it will start working.
Adding break in frmactualfolder.html, browser.html, common.js seems to solve problem introduced in #1919. Interesting that adding the same break in the catch block in server connectors is causing errors. I don't understand exatcly what's going on here, but with this patch everything seemed to work fine. I haven't tested it deeply yet, unfortunately.
comment:9 follow-up: ↓ 12 Changed 4 years ago by fredck
- Status changed from new to closed
- Resolution set to fixed
I've committed the patch for the urgent 2.6.1 release to happen today.
Fixed with [2059]. Click here for more info about our SVN system.
comment:10 Changed 4 years ago by martinkou
- Keywords Review+ removed
- Status changed from closed to reopened
- Resolution fixed deleted
Adding break in the catch blocks of frmactualfolder.html, browser.html and common.js actually disabled the domain relaxation logic in the three files. And it is causing permission denied errors when a file is being clicked in the file browser.
comment:11 Changed 4 years ago by fredck
- Status changed from reopened to closed
- Resolution set to fixed
@martinkou, please open a new ticket for this issue. This one has already been fixed, closed and released.
comment:12 in reply to: ↑ 9 ; follow-up: ↓ 13 Changed 4 years ago by mxm
- Status changed from closed to reopened
- Resolution fixed deleted
- Component changed from File Browser to Server : ASP.Net
- Milestone changed from FCKeditor 2.6.1 to FCKeditor 2.6.4
Replying to fredck:
I've committed the patch for the urgent 2.6.1 release to happen today.
Fixed with [2059]. Click here for more info about our SVN system.
Please, change the line 118 in the FileWorkerBase.cs! It is aspx-connector and it should be like asp-connector:
Response.Write( @"(function(){var d=document.domain;while (true){try{var A=window.parent.document.domain;break;}catch(e) {};d=d.replace(/.*?(?:\.|$)/,'');if (d.length==0) break;try{document.domain=d;}catch (e){break;}}})();" );
comment:13 in reply to: ↑ 12 Changed 4 years ago by fredck
- Status changed from reopened to closed
- Resolution set to fixed
Replying to mxm:
Please, change the line 118 in the FileWorkerBase.cs! It is aspx-connector and it should be like asp-connector:
Same thing here... please open a dedicated ticket for it, explaining the current problem and how to solve it.
comment:14 Changed 4 years ago by fredck
- Component changed from Server : ASP.Net to File Browser
- Milestone changed from FCKeditor 2.6.4 to FCKeditor 2.6.1

