evanw / evanw/node-source-map-support

XMLHttpError on Chrome Extension page, original error discarded

Open
#143 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
2.2k
Forks
223
PR merge metrics
No merged PRs in 30d

Description

Having a problem using `source-map-support` in a Chrome extension. Narrowed it down to a failed attempt to retrieve an extension-specific page (`extensions::uncaught_exception_handler`) via XMLHttpRequest. The impact is that any errors that occur within these chrome API callbacks get eaten.

Screenshot:

![image](https://cloud.githubusercontent.com/assets/2312275/16902514/c4397e30-4c2e-11e6-8edb-9a4096de7fe0.png)

The `XMLHttpRequest` error seems to print regardless of whether the `send` is in a `try..catch`, and only clutters the console. The `NetworkError` is the one that is blocking.

Minimal example [here](https://github.com/chrahunt/node-source-map-support-repro).

A good solution to this would not show the XMLHttpRequest error and for irretrievable intermediate sources in the stack just show the original "file"/line number. A try...catch could take care of the latter. To avoid displaying the cosmetic error it could help to check for known valid protocols, but that won't work in all cases since it depends on permissions I don't think are queryable without trying the request.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.