Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

consider normalizing filename #6

Open
LarsDenBakker opened this issue Jan 1, 2021 · 3 comments
Open

consider normalizing filename #6

LarsDenBakker opened this issue Jan 1, 2021 · 3 comments

Comments

@LarsDenBakker
Copy link
Contributor

Currently the filename property is the raw browser stack location, which includes the browser protocol, hostname and port on some browsers but not on others. Also query parameters and hashes are included. It would be useful to normalize this across browsers as well.

@marvinhagemeister
Copy link
Owner

I'm trying to think of a generalized way to do normalize, that isn't application specific. It may be that errors only occur at the presence of specific query params or hashes. Can you share some of the locations you'd love to be normalized?

@LarsDenBakker
Copy link
Contributor Author

I think there are a couple of things to consider:

  1. Is the filename the browser url or a file path? For the test runner we make it a file path so that the user can click to view the file from the terminal.
  2. Do you preserve the query params or hash? In the test runner we add the session id in the params, which we don't want to show in the stack traces.
  3. Do you preserve the protocol and hostname? For instance webkit shows http://localhost:8000/foo/bar.js while chrome and firefox show /foo/bar.js

@rickmed
Copy link

rickmed commented Jan 30, 2023

Could it be normalized up to the URL and then decide what to do with the query string?

(? means optional below)

env: "firefox" | "chrome" | "node"....
protocol: "file:///" | "http://" | "https://"...
file: {
  fullPath: "foo/qux/bar.js",
  path: ["foo", "qux"],
  name: "bar.js",
  // would be ideal here: column, line... 
},
host?:   (can be normalized further: subdomain, domain, port)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants