What is window.origin?

WindowOrWorkerGlobal.origin returns the origin of the environment, Location.origin returns the origin of the URL of the environment. Unfortunately Stack-Snippets null-origined frames will make for a confusing example… At the risk of paraphrasing the specs themselves, let’s say we are on https://example.com and from there, we create a new <iframe> element without an src attribute: var … Read more

Safari not setting CORS cookies using JS Fetch API

Answering my own question. I find it pretty enraging that this is a “working as intended” behaviour of Safari, though I understand their motivation. XHR (and presumably native fetch when it lands natively) does not support the setting of third-party cookies at all. This failure is completely transparent because it is handled by the browser … Read more

Access is denied error on XDomainRequest

I found the reason of this problem. As stated in Point 7: Requests must be targeted to the same scheme as the hosting page This restriction means that if your AJAX page is at http://example.com, then your target URL must also begin with HTTP. Similarly, if your AJAX page is at https://example.com, then your target … Read more

tech