Comments (14)
I also see this in IE8 (maybe 9, but I can't be sure)
from airbrake-js.
It's in both IE8 & IE9.
from airbrake-js.
I managed to pass the IE9 issue with the following script
:javascript
(function() {
var tk = document.createElement('script');
tk.src = "https://ssljscdn.airbrake.io/notifier.min.js";
tk.type = 'text/javascript';
tk.async = 'true';
tk.onload = tk.onreadystatechange = function() {
var rs = this.readyState;
if (rs && rs != 'complete' && rs != 'loaded') return;
Airbrake.setRequestType('GET');
Airbrake.setGuessFunctionName(false);
Airbrake.setKey('#{Airbrake.configuration.api_key}');
Airbrake.setEnvironment('#{Rails.env}');
Airbrake.setErrorDefaults({
url: document.URL,
component: "#{controller_name}",
action: "#{action_name}",
});
};
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(tk, s);
})();
On IEs older than 9 this doesn't work.
Could you please fix the insecure content
warning?
Thanks.
from airbrake-js.
- Why check for both complete and loaded readystates? (Surely just complete would be enough?)
- I was just reading this which suggests that we should not use both onload and onreadystatechange.
- I've no idea why that wouldn't work in IE8...
from airbrake-js.
Actually, I think I know why it's not working in IE8 - IE9 supports onload as well as onreadystatechange, so maybe the onreadystatechange part isn't working?
Can you try this?
(function() {
var tk = document.createElement('script');
tk.src = "https://ssljscdn.airbrake.io/notifier.min.js";
tk.type = 'text/javascript';
tk.async = 'true';
var cb = function() {
if (this.readyState && this.readyState != 'complete') return;
Airbrake.setRequestType('GET');
Airbrake.setGuessFunctionName(false);
Airbrake.setKey('#{Airbrake.configuration.api_key}');
Airbrake.setEnvironment('#{Rails.env}');
Airbrake.setErrorDefaults({
url: document.URL,
component: "#{controller_name}",
action: "#{action_name}",
});
};
if(tk.addEventListener) {
tk.addEventListener('load', cb, false);
} else if(tk.readyState) {
tk.onreadystatechange = cb;
}
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(tk, s);
})();
from airbrake-js.
Hi Iain,
Tried the script and it works, kind of. I don't get the Airbrake is undefined
issue anymore but I get something else. See the screenshot. That happens when an js error appears (deliberately added one) and it seems to be a loop there. Both IEs 8 and 9 became unresponsive and hardly managed to close them.
from airbrake-js.
I think that's a problem with the airbrake script itself. By my calculations of where character 9133 occurs in the minified script, it's failing on notifier.js line 409 (calling open on an XMLHttpRequest).
After doing a little searching it turns out that IE 8 and 9 don't support using XMLHttpRequests for cross-domain ajax requests (see here and here and that's exactly what notifier.js tries to do when sending data to airbrake.
Based on that, it seems like to support IE < 10 notifier.js should check which browser it's running in, and use XDomainRequest instead of XMLHttpRequest for IE.
However, looking at the code, it seems that the problem might be confined to POST requests, as notifier.js uses an iframe for GET requests (to avoid the CORS issue, presumably?). Can you confirm that your config is definitely using GET, as in your original message (above)?
from airbrake-js.
Hi Iain,
Yes I'm using "GET" as in those examples. Right now I use the airbrake gem and airbrake_javascript_notifier
(which is not async) works in all IEs.
Do you want me to paste what JS returns the airbrake_javascript_notifier
tag ?
from airbrake-js.
I'm out of ideas. I'm not sure if taking what the gem produces will help diagnose the problem.
Looking at the code, the notifier uses POST requests for JSON data and GET requests for XML data. By default it uses GET and XML, and you're not changing that in the code above.
from airbrake-js.
Maybe I've diagnosed notifier.min.js character 9133 incorrectly?
@benarent do you have any ideas?
from airbrake-js.
Hi Iain,
Could you please fix the insecure content notice (The page at about:blank displayed insecure content from http://api.airbrake.io/notifier_api/v2/notices?)
. I want to test for a couple of days everything but IEs. Thanks.
from airbrake-js.
FYI @razvan-sv I don't work for airbrake! I'm just an open-source contributor like everyone else.
Your error sounds like your site is using https but the airbrake notifier is contacting airbrake over http. I don't have time to investigate at the moment though
from airbrake-js.
Hi @razvan-sv ... Can you tell me more about the issue, should you be using https://
is this your issue? Feel free to hit me up on IM. [email protected] and I'll help you out.
Ben
from airbrake-js.
Sorry Iain didn't notice :-).
@benarent - One of the issues is that when I'm using the https://ssljscdn.airbrake.io/notifier.min.js
I get a insecure content warning in Chrome saying that the code uses http://airbrake instead of https://. I also saw that in the minified js file (m="http://"+this.options.host+"/notifier_api/v2/notices"
). These insecure content warnings are basically errors in IEs - that's what I saw, I'm no js expert.
The other issue is that I couldn't make the async code + https version work on IEs. You can see the messages above. I was thinking about how does the airbrake_javascript_notifier
work in IE without raising any errors?
Btw - I'm using airbrake + SSL all the time
Thanks !
from airbrake-js.
Related Issues (20)
- Reduce package size HOT 6
- Params not passed on notify method with React ErrorBoundary HOT 1
- This dependency was not found: * async_hooks in ./node_modules/@airbrake/node/esm/scope.js
- Object Not Found Matching Id:3
- Github security alerts
- Cross-Fetch dep is trying to use XHR in service-worker context. HOT 2
- [Documentation] Version 1 to Version 2 Migration Guide
- Unable to post sourcemaps to /v4/projects/:projectId/sourcemaps HOT 2
- Too aggressive error grouping
- No backtrace on error HOT 3
- Uncaught ReferenceError: Notifier is not defined airbrake angularjs HOT 1
- security update: cross-fetch HOT 7
- Airbrake not globally available when using webpacker
- Using blocklist with "name" filters out notifier name HOT 2
- error-stack-parser versions < 2.1.4 causes stack parsing to fail with `ErrorStackParser.parse is not a function` error HOT 2
- Simplify "notify" for error reporting
- Test suite shouldn't make network calls
- AbortError: The user aborted a request.
- Use of instrumentation.fetch for Performance Statistics HOT 1
- Rejected error with Cybersource Flex Microform JS HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from airbrake-js.