Skip to content

Tag: detection

Can I programmatically detect whether a CORB error occurred?

I’m looking for a way to programmatically detect (using JavaScript) whether a resource load on my page (over which I have full control) was blocked by Cross-Origin Resource Blocking. For instance, because the response from has Content-Type text/html; charset=UTF-8, the following HTML code would trigger a CORB error in Chromium-based browsers: But how can I detect that it occurred?

Detect mouse direction – JavaScript

This is how I detect the mouse direction and it works so good but it works only on Chrome, how I can make this compatible with other browsers (Firefox, Opera and at least ie8+ or ie9+). No jQuery please. Answer Stick with pageX and define oldx in a higher scope, otherwise it’s always zero FIDDLE

detecting a redirect with javascript – how?

Is there any way to detect whether a webpage is going to redirect me to another, knowing its URL? I mean the situation when you type URL in a text field and the script examines it for 3xx redirections. Answer Yes, you can do this quite easily in Javascript. It’d look something like: Unfortunately, this only works on your own