bitovi / bitovi/funcunit

F.open() doesn't throw when violating same-origin

Open
#156 0 comments 0 reactions 0 assignees View on GitHub
bug help wanted p3
Dominant language
JavaScript
Stars
571
Forks
370
PR merge metrics
No merged PRs in 30d

Description

You can't, for example, load google.com from localhost. This fails, but does so silently.

We do catch the error in a try/catch [here](https://github.com/bitovi/funcunit/blob/874b4f9fe8870080b5070139e67d72a8fd3e52d7/browser/open.js#L274). We could improve this by checking the error in the catch and if it is a SecurityError, rethrow so the user can see the error.

Chrome and Firefox give a different error message, so detecting this might be tricky.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at browser/open.js around line 274, where the error is caught after F.open() attempts a cross-origin load. Compare the SecurityError behavior in Chrome and Firefox, then make the violation visible instead of silently catching it. Done means the same-origin failure is rethrown and covered for the reported behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.