Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
728 views
in Technique[技术] by (71.8m points)

"unsafely-treat-insecure-origin-as-secure" flag is not working on Chrome

I am using geo-location for a site running locally on my machine using HTTP on Chrome. However this does not work as I am running on HTTP as opposed to HTTPS.

On the console it says:

getCurrentPosition() and watchPosition() no longer work on insecure origins.
To use this feature, you should consider switching your application to a 
secure origin, such as HTTPS. See https://sites.google.com/a/chromium.org/dev/Home/chromium-security/deprecating-powerful-features-on-insecure-origins 
for more details.

Accoriding to Deprecating Powerful Features on Insecure Origins its says to start chrome using --unsafely-treat-insecure-origin-as-secure="http://example.com" flag. The command I ran was similar to:

chrome.exe --unsafely-treat-insecure-origin-as-secure="http://hello.app"

However, the same error message still appears.

How can I fix this issue.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

None of the solutions worked for me.

I achieved this by following steps.

  1. Type chrome://flags/#unsafely-treat-insecure-origin-as-secure in the address bar.
  2. Add the origin which you need to treat as secure as shown in the below image.

enter image description here

  1. Relaunch chrome.

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...