This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
reloadWithDebugInfo does not work when the host already uses window.name #13031
Open
Description
I am not sure how much of an edge case this is, but the reloadWithDebugInfo
call relies on window.name
not to be used outside of angular.
We have a script-tag in our head setting the window.name
for our application, this causes the implementation for reloadWithDebugInfo
not to work.
Lines 1600 to 1638 in 19ecdb5
Angular version: 1.4 (but I assume this applies to 1.3 as well)
Browser: every browser
Reproduce: add a script tag with window.name = 'some name'
in your page head, disable debug info in your config, confirm angular.reloadWithDebugInfo()
does not work
Suggested fixes:
- maybe use a query string parameter instead? Seems to me like
NG_ENABLE_DEBUG_INFO!
won't be a widely used query string? - use a cookie: if you use a cookie, you can let it expire with the session, and it would be possible to implement a
reloadWithDebugInfo(false)
call to reset it - use local storage: similar as cookie, this is more persistent