-1

hope you all have a great day. I would just like to ask some help regarding the issue I encountered. I was trying to test my react web app on browserstack mobile screens, currently I am testing locally using localhost.

Also the URL is redirected to http://bs-local.com from http://localhost.

Now when I access the localhost on browserstack I am receiving the ff issue below and I can't also access the google map api and the endpoints but it works well when I test it in the browser (only on browserstack that I have this error).

Is it possible that we can test localhost on browserstack ? particularly when google maps api ?

Thank you. Any help would be much appreciated.

error-screenshot

[Error] Failed to load resource: Origin http://bs-local.com:3000 is not allowed by Access-Control-Allow-Origin. Status code: 204 (properties, line 0)

mobile screen on browserstack local

Jhon Caylog
  • 483
  • 8
  • 24
  • 2
    Does this answer your question? [Rails 5: Access to geolocation was blocked over insecure connection to http://localhost:3000](https://stackoverflow.com/questions/46339325/rails-5-access-to-geolocation-was-blocked-over-insecure-connection-to-http-lo). specifically the *"Safari (unlike Chrome and Firefox) does not allow access to geolocation over the HTTP protocol - only HTTPS. Even for localhost. Thanks a lot Apple."* – Bagus Tesa Jul 19 '23 at 02:23
  • does not seem to work , I also have tried all the possible browsers Sir. – Jhon Caylog Jul 19 '23 at 02:26
  • Also the answers give on the link is specific to rails , currently I am using react. – Jhon Caylog Jul 19 '23 at 02:27
  • 1
    i do remember apple ever throw a fit for browser that sport their own rendering engine.. – Bagus Tesa Jul 19 '23 at 02:27
  • 1
    Technically, Chrome & Firefox doesn't allow those features over HTTP too, but localhost gets a special exception. – Martheen Jul 19 '23 at 02:28
  • 1
    (ruby on) rails is for the **backend**, while your problem is on your **frontend**. there are a lot of people asking question while providing irrelevant information. part of the information in that QA though, usable and **fits** your current state. go grab another OS and see if it works. – Bagus Tesa Jul 19 '23 at 02:29
  • what do you mean by localhost having special excemption Sir ?. Thanks. – Jhon Caylog Jul 19 '23 at 02:29
  • 1
    Firefox and Chrome security rules are relaxed for `localhost`. – Bagus Tesa Jul 19 '23 at 02:30
  • I tried anroid OS and it seems to work now the only problem is on IOS which I need to test some screens there. – Jhon Caylog Jul 19 '23 at 02:33
  • 1
    @JhonCaylog see, its [apple being apple](https://www.macrumors.com/2022/12/14/apple-considering-non-webkit-iphone-browsers/). – Bagus Tesa Jul 19 '23 at 02:35
  • @BagusTesa , yeah exactly , my idea now is just to deploy the changes on the dev env on azure and just have the link access and test it on apple mobile screens since localhost on apple stands no chance hehe. But I do appreciate the help Sir. Thank you – Jhon Caylog Jul 19 '23 at 02:36

1 Answers1

1

I suspect if there are some SSL inspections going on there which may be blocking the access to geolocation over insecure connection to http://bs-local.com:3000.

Regarding “Access-Control-Allow-Origin” with status code 204 means, that the server has successfully processed your request, but isn't going to return any content.

I would suggest you to please raise a support ticket with BrowserStack support team to get help with this issue.

Thanks!

HomeLander
  • 61
  • 3