File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -1636,14 +1636,14 @@ Raven.prototype = {
16361636 } ;
16371637 }
16381638
1639- if ( this . _hasDocument ) {
1640- if ( _document . location && _document . location . href ) {
1641- httpData . url = _document . location . href ;
1642- }
1643- if ( _document . referrer ) {
1644- if ( ! httpData . headers ) httpData . headers = { } ;
1645- httpData . headers . Referer = _document . referrer ;
1646- }
1639+ // Check in `window` instead of `document`, as we may be in ServiceWorker environment
1640+ if ( _window . location && _window . location . href ) {
1641+ httpData . url = _window . location . href ;
1642+ }
1643+
1644+ if ( this . _hasDocument && _document . referrer ) {
1645+ if ( ! httpData . headers ) httpData . headers = { } ;
1646+ httpData . headers . Referer = _document . referrer ;
16471647 }
16481648
16491649 return httpData ;
You can’t perform that action at this time.
0 commit comments