Skip to content
This repository was archived by the owner on Aug 28, 2023. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions tracekit.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,12 +347,7 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
*/
function getSource(url) {
if (!_has(sourceCache, url)) {
// URL needs to be able to fetched within the acceptable domain. Otherwise,
// cross-domain errors will be triggered.
var source = '';
if (url.indexOf(document.domain) !== -1) {
source = loadSource(url);
}
var source = loadSource(url);
sourceCache[url] = source ? source.split('\n') : [];
}

Expand Down Expand Up @@ -618,8 +613,8 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
return null;
}

var chrome = /^\s*at (?:((?:\[object object\])?\S+) )?\(?((?:file|http|https):.*?):(\d+)(?::(\d+))?\)?\s*$/i,
gecko = /^\s*(\S*)(?:\((.*?)\))?@((?:file|http|https).*?):(\d+)(?::(\d+))?\s*$/i,
var chrome = /^\s*at (?:((?:\[object object\])?\S+) )?\(?((?:file|http|https|chrome|widget|chrome-extension):.*?):(\d+)(?::(\d+))?\)?\s*$/i,
gecko = /^\s*(\S*)(?:\((.*?)\))?@((?:file|http|https|chrome|widget|chrome-extension).*?):(\d+)(?::(\d+))?\s*$/i,
lines = ex.stack.split('\n'),
stack = [],
parts,
Expand Down