Closed Bug 249834 Opened 21 years ago Closed 20 years ago

security settings won't allow event handler to close window opened by script

Categories

(Core :: Security: CAPS, defect)

x86
Windows XP
defect
Not set
major

Tracking

()

RESOLVED EXPIRED

People

(Reporter: DmiG, Assigned: dveditz)

Details

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040514 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040514 Security settings won't allow event handler (set to button in child window) to close window opened by script in parent window, if child window opened with url='' and filled with contents dynamically by script in parent window. Reproducible: Always Steps to Reproduce: function renameGroup(grid, grname, grdesc, act){ var dlg = window.open('' /*we won't load anything into this window*/, "sometitle", "toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=300, height=120"); var bodyRef = dlg.document.getElementsByTagName("body").item(0); dlg.document.title = "title"; var frm = dlg.document.createElement('form'); frm.method = 'POST'; frm.action = act; frm.addEventListener("submit", function(){self.parent.focus(); self.parent.document.location.reload(false); self.close();/*the first place to get info message in JS console*/}, false); var _br = dlg.document.createElement('br'); var _el = dlg.document.createElement('input'); _el.type = 'hidden'; _el.name = 'id'; _el.value = grid; frm.appendChild(_el); var _el = dlg.document.createTextNode("Name: "); frm.appendChild(_el); _el = dlg.document.createElement('input'); _el.type = 'text'; _el.size = '50'; _el.name = 'name'; _el.value = grname; frm.appendChild(_el); frm.appendChild(_br); _el = dlg.document.createTextNode("Description: "); frm.appendChild(_el); _el = dlg.document.createElement('input'); _el.type = 'text'; _el.size = '50'; _el.name = 'desc'; _el.value = grdesc; frm.appendChild(_el); _br = dlg.document.createElement('br'); frm.appendChild(_br); _br = dlg.document.createElement('br'); frm.appendChild(_br); var _el = dlg.document.createElement('input'); _el.type = 'submit'; _el.value = 'Save'; frm.appendChild(_el); var _el = dlg.document.createElement('input'); _el.type = 'button'; _el.addEventListener("click", function(){self.parent.focus(); self.close() /*the second place to get message*/;}, false); _el.value = 'Cancel'; frm.appendChild(_el); bodyRef.appendChild(frm); } Actual Results: Message 'Scripts may not close windows that were not opened by script.' in JS console Expected Results: Child window have been closed as in case if some page was loaded into it (with same code, as generated by script).
Severity: normal → major
This is an automated message, with ID "auto-resolve01". This bug has had no comments for a long time. Statistically, we have found that bug reports that have not been confirmed by a second user after three months are highly unlikely to be the source of a fix to the code. While your input is very important to us, our resources are limited and so we are asking for your help in focussing our efforts. If you can still reproduce this problem in the latest version of the product (see below for how to obtain a copy) or, for feature requests, if it's not present in the latest version and you still believe we should implement it, please visit the URL of this bug (given at the top of this mail) and add a comment to that effect, giving more reproduction information if you have it. If it is not a problem any longer, you need take no action. If this bug is not changed in any way in the next two weeks, it will be automatically resolved. Thank you for your help in this matter. The latest beta releases can be obtained from: Firefox: http://www.mozilla.org/projects/firefox/ Thunderbird: http://www.mozilla.org/products/thunderbird/releases/1.5beta1.html Seamonkey: http://www.mozilla.org/projects/seamonkey/
This bug has been automatically resolved after a period of inactivity (see above comment). If anyone thinks this is incorrect, they should feel free to reopen it.
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → EXPIRED
You need to log in before you can comment on or make changes to this bug.