这是indexloc提供的服务,不要输入任何密码
Skip to content

Default AJAX function does not work for file:/// protocol #40

@zmbc

Description

@zmbc

Expected Behavior

When using stacktrace-gps, sourcemaps should be fetched correctly, even from the filesystem.

Current Behavior

AJAX of sourcemaps only works for HTTP.

Steps to Reproduce (for bugs)

  • Serve a website from the filesystem using file:///
  • Try to sourcemap a stacktrace

Context

My real-world situation is trying to use stacktrace-gps in a Cordova app. But I can imagine people might want to use the filesystem in other situations, too.

Your Environment

  • stacktrace.js version: 1.3.1
  • Browser Name and version: Chrome 53 on desktop, UIWebView on iOS
  • Operating System and version (desktop or mobile): Tested on Mac OSX, Ubuntu 14.04, and iOS 8

Possible Solution

The issue is that stacktrace-gps depends on HTTP status codes. I fixed this issue for myself with a change to this line, simply assuming a success if the protocol was file:/// and there was responseText. That's probably not the best solution, but it should be a start.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions