Using BLHQ with JavaScript

35 views
Skip to first unread message

KrunchMuffin

unread,
Oct 31, 2014, 9:04:20 AM10/31/14
to bugl...@googlegroups.com
How are people using this with JS errors? I tried to implement it inside an ajax error: but I get 
"Resource interpreted as Script but transferred with MIME type text/html:" 
and 
"Refused to execute script from 'buglog/listeners/bugLogListenerREST.cfm?message=JS%20…rse.dev/assets/scripts/source/pages/addevent.js%22%2C224%2C29%29%3C/pre%3E' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled."

I also get the same message when trying to use window.onerror. In Chrome, didn't try other browsers.

KrunchMuffin

unread,
Oct 31, 2014, 9:20:01 AM10/31/14
to bugl...@googlegroups.com
So I may have fixed it. What I did was add <cfheader name="Content-type" value="application/javascript"> at the top of bugLogListenerREST.cfm. It logged the bug like a champ. Now, if you are using the REST page for other things and not just JS, then I would imagine you would have to create a new file specifically to handle JS errors.

Oscar Arevalo

unread,
Oct 31, 2014, 10:07:14 AM10/31/14
to bugl...@googlegroups.com
Hey KrunchMuffin,
It's been a while since I used BugLogHQ for JS errors, but don't remember seeing that error. But maybe something has changed in the meanwhile. Anyway, that's a good find and should get integrated into the project.

By the way, you got those errors while posting directly to the listener or were you using the JS client that is included with BugLogHQ?

Thanks!

Oscar

--

---
You received this message because you are subscribed to the Google Groups "BugLogHQ" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bugloghq+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Oscar Arevalo

KrunchMuffin

unread,
Oct 31, 2014, 10:40:31 AM10/31/14
to bugl...@googlegroups.com
Was using the JS client. I made a pull request for it as well with those details.

Oscar Arevalo

unread,
Oct 31, 2014, 11:03:59 AM10/31/14
to bugl...@googlegroups.com
Yup, I saw the PR as soon as I wrote the email :)

I wonder if there is something on the request that can be used by the "REST" listener to automatically set the content-type only when needed. 

Or maybe setting it always to application/json may be friendlier to Javascript?

Oscar

KrunchMuffin

unread,
Oct 31, 2014, 11:07:03 AM10/31/14
to bugl...@googlegroups.com
I can try application/json and see if it works

KrunchMuffin

unread,
Oct 31, 2014, 11:08:09 AM10/31/14
to bugl...@googlegroups.com
Negative.

Refused to execute script from /buglog/listeners/bugLogListenerREST.cfm?message=JS%20…rse.dev/assets/scripts/source/pages/addevent.js%22%2C225%2C29%29%3C/pre%3E' because its MIME type ('application/json') is not executable, and strict MIME type checking is enabled. 

Oscar Arevalo

unread,
Oct 31, 2014, 11:12:40 AM10/31/14
to bugl...@googlegroups.com
Ok, good to know, since the listener on 2.0 will always send a proper Json response:

https://github.com/oarevalo/BugLogHQ/blob/2.0/listener/index.cfm

This will need to be taken into consideration for that.


Reply all
Reply to author
Forward
0 new messages