You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.
Do you want to request a feature or report a bug?
A bug.
What is the current behavior?
Currently the script element created for JSONP request is appended to document.body and removed on load or error callback: httpBackend.js#L187
rawDocument.body.removeChild(script);
This will fail if the script was removed before the callback was fired.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://plnkr.co or similar (template: http://plnkr.co/edit/tpl:yBpEi4).
What is the expected behavior?
Add a parentNode check instead of hardcoded document.body reference:
if (script.parentNode) script.parentNode.removeChild(script);
What is the motivation / use case for changing the behavior?
Which versions of Angular, and which browser / OS are affected by this issue? Did this work in previous versions of Angular? Please also test with the latest stable and snapshot (https://code.angularjs.org/snapshot/) versions.
Other information (e.g. stacktraces, related issues, suggestions how to fix)
The text was updated successfully, but these errors were encountered:
I assume you ran into this issue. In order to better understand the issue, under what circumstances can this happen (the script being removed before the callback being called)?
In my scenario we're scraping the page with PhantomJS and then remove (nearly) all the sripts from the page. This ends in document.body.removeChild(script) call to already removed/detached element.
I do understand it's a very rare condition but the check itself is not big either.
Note: for support questions, please use one of these channels: https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#question. This repository's issues are reserved for feature requests and bug reports.
Do you want to request a feature or report a bug?
A bug.
What is the current behavior?
Currently the
script
element created for JSONP request is appended todocument.body
and removed onload
orerror
callback:httpBackend.js#L187
This will fail if the script was removed before the callback was fired.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://plnkr.co or similar (template: http://plnkr.co/edit/tpl:yBpEi4).
What is the expected behavior?
Add a parentNode check instead of hardcoded
document.body
reference:What is the motivation / use case for changing the behavior?
Which versions of Angular, and which browser / OS are affected by this issue? Did this work in previous versions of Angular? Please also test with the latest stable and snapshot (https://code.angularjs.org/snapshot/) versions.
Other information (e.g. stacktraces, related issues, suggestions how to fix)
The text was updated successfully, but these errors were encountered: