Site cannot be installed: the page is not served from a secure origin - google-chrome

I have created manifest.json to a site to enable to save the web app icon on a desktop.
My developer website is over http - Which doesn't work when I click on add to home screen from application tab.
I am getting console error:
Site cannot be installed: the page is not served from a secure origin
The same code works over https.
How can I simply bypass this issue in http
Note : I have followed the following step in chrome browser, it didnt resolve my issue.
Stackoverflow previously Question
Any help will be greatly appreciated.

chrome://flags/#unsafely-treat-insecure-origin-as-secure
enabled and add site origin

The problem was service workers will only register and install on the secure origin. So followed following steps:
1) Go to chrome.exe path in the program files create shortcut of the chrome on the desktop
2) right click on the shortcut - Go to properties - update the target with the below changes
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --unsafely-treat-insecure-origin-as-secure=http://wzy.xyz.com,http://x.xyz.com --user-data-dir=/anydirectory/
Note: Make sure that you google chrome executable file is present in the above mentioned location.
Also this is only to test in the local environment.

Related

Capture Downloads in the Network Tab of Google Chrome Developer Tools

The Network tab in the Google Chrome Developer Tools window shows almost all http requests made, but does not seem to capture anything when the http request results in a file being downloaded.
How can I capture download requests in Google Chrome?
I am sure that your file download is happening by opening a new window. Network tab of developer tools only captures the request of current tab.
For example, following link will download the file but it will not appear in the network tab.
Click Here to Download file
Similar type of things can be done using javascript using (window.open, dynamic hyperlink/iframe), which will not appear in the network tab.
Various Javascript approach you can check here
I have observed similar behaviour in my past.
You cane check the chrome://net-internals in older version of chrome and chrome://net-export/ in the newer version of chrome to monitor any type of request being made by any instance/tab of chrome.
Note: You can check the internal events of chrome by typing chrome://net-export/ in the url box of chrome.
I have faced similar issue, and here's how I solved it.
Issue:
Debug an anchor link that download file upon clicking it.
Debugging Process:
Steps
Go to chrome://settings/content/automaticDownloads?search=download and disable auto download
Open chrome dev tools, Settings -> Global -> Auto-open DevTools for popup
Open chrome dev tools, Settings -> Console -> Preserve log upon navigation
I hope that helps.
This works without changing any settings of Chrome for a single download-request. It however does not automatically display all download-requests triggered in a different tab or window.
Trigger the download in the GUI.
Open Chrome's download history (chrome://downloads/).
Right-click your download and Copy link address.
Open DevTools, paste the link into the address bar of the corresopnding Chrome tab and execute it.
The download-request shows in the DevTools.
You can use Fiddler for a more grainy look into your network traffic:
https://www.telerik.com/fiddler
*I don't work for fiddler
What do you mean by capture?
If you meant that nothing showed up in preview tab or in response tab, it's because the response is the actual file being downloaded.
I've recently tried downloading Oracle JDK 11 with dev-tools open in network tab and here is what I got:
I have no particular configuration in this version of Chrome (Versione 71.0.3578.98 (Build ufficiale) (a 64 bit))
As #jlvaquero said, if you're trying to get as much details as possibile, try WireShark on your own local pc.
I can see it in my case by downloading a document from google drive and limit download speed to 3G.
First step : Open with f12 the programmer toolbar.
Step Two : Go to the networking tab and locate the video in question. To help filter by clicking on media.
Step Three : If the video has no protection you can right click, click open on a new tab and download with crtl + s. If this does not work is because the video has parameters to prevent it from doing so. In that case right click again, go to the COPY session and then click copy as cURL.
Step Four : Go to your linux terminal (If you use windows turn around), if you don't have curl installed type sudo apt install curl and then paste the copied CURL command from the developer bar.
Step 5 : Before executing the command you need to add at the end of it --output video.mp4 --insecure as it is a binary. The insecure parameter is if you have problem with certificate. Wait for the download to complete and be happy!
Obs: This link can help you: https://www.hanselman.com/blog/HowToDownloadEmbeddedVideosWithF12ToolsInYourBrowser.aspx
Google Chrome has been updated to support downloads in the Network Tab
This question was asked in February of 2018, and at the time Google Chrome did not support downloads in the Network tab.
I have verified this by downloading the 64.0.3282.140 build of Google Chrome.
And then attempted to download Spotify as an example and found no event appear in the network tab.
Any Google Chrome version released in 2019 or later will capture all download requests in the Network tab.

ExtensionInstallSources in Chrome extensions for Enterprise policy

We have google chrome extension that needs to be used inside our organization. We have domains there.
Based on enterprise options the easiest approach for us is to host it on some internal web server, and then add address of that internal site as ExtensionInstallSources option to users PC via Group policies, but this does't work for me.
I've tried both registry and local Group Policy changes by adding Google Chrome adm\admx files.
Here is my registry change:
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome\ExtensionInstallSources]
"1"="http://localhost/*"
When i'm checking chrome://policy - it displays that it loaded this settings. But when i open http://localhost/myextension.crx - Chrome still displays an error that extension can't be installed from there...
I'm using 47.0.2526.106 m (64-bit) under Windows 8.1 Enterprise (x64)
What i'm doing wrong here?
I have more complicated option to download chrome source\pdbs, and then try to debug it to get understanding why it's not working but it may take a lot of time, as Chrome can compile for a couple of hours on Windows at first build....
So apparently this registry change just wasn't enough. After debugging chrome source i found why it doesn't work for me. I missed:
The referer MUST be present and it also should be whitelisted. So if i open url for my extension by direct link, then as referer is missing - it won't install it. (Oh Chrome, at least you could say with message about it...). If i have web page that has link to that extension, and it's also whitelisted, then it will work fine.
Second missed point was that extension id MUST be present in ExtensionInstallWhitelist, otherwise Chrome will install it and with 2-3 seconds delay will disable it. But if you have listed it under ExtensionInstallWhitelist, then it will be fine.
So my final registry change for localhost is:
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome]
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome\ExtensionInstallSources]
"1"="http://localhost/*"
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome\ExtensionInstallWhitelist]
"1"="fhojekmcngnmkdbcoegjdlojgfngkpak"
I found it after long debugging in ExtensionManagement class - https://code.google.com/p/chromium/codesearch#chromium/src/chrome/browser/extensions/extension_management.cc&q=ExtensionManagement::IsOffstoreInstallAllowed&sq=package:chromium&type=cs&l=148

How to create a hyperlink to shared network directory or file?

I've checked the following two related discussions:
1. How do I make a hyperlink to a local executable?
2. An URL to a Windows shared folder
3. File Url Cross Domain Issue in Chrome- Unexpected
4. Firefox Links to local or network pages do not work
The following links work when I visited the website on localhost. That is, http://localhost.
A Shared Network Directory
A Shared Network Directory
A Shared Network Directory
But when I visited with http://172.21.1.123, all of above links have no response.
The debug console shows that Not allowed to load local resource: file://172.21.1.123/DIR.
Test Environment (Both of them have the same result.):
- Chrome 28.0.1500
- IE 10
If it is due to the security reason, any configuration to turn off? Or any idea?
The reason that you cannot link to a network share from an external/hosted/live site is because of security features of latest browsers like Firefox.
You can only open local network shares from a local HTML document.
The only way around this is to install a plugin for your browser that removes or disables this security feature as far as I know.

WebGL Inspector Extension Does Not Appear in Chrome for file:// urls?

My steps (these are the ones described in the docs), under Win 7:
Downloaded/unpacked the zip file
using cygwin, ran the buildextensions.sh file, which created the lib and extensions dirs
opened Chrome
installed the webgl extension via the chrome store
(various repeats of closing/relaunched chrome along the way from here on, with little help)
chrome setup->extnesions, make sure webgl is enabled
turn on developer mode, "load unpacked extension...." selecting the (created) extensions/chrome directory (in this case, C:\Users\kbjorke\Documents\benvanik-WebGL-Inspector-6108bee\benvanik-WebGL-Inspector-6108bee\core\extensions ) and allow "file://" url's
??? no amount of relaod/update/restart seems to cause the GL logo to appear among the extensions buttons at upper right -- even when I load webgl-intensive pages, UNLESS I first load a webgl page from some NON-file:// page -- if I open another tab with an http:// webgl page, I see the red "GL" indicator TWICE in that address bar, but they both lead to the http:// page, not my file:// !
How can I get at my own page, short of pushing it to an external server?
Use a local server. Just open a command prompt, cd to your webpages and then type
python -m SimpleHTTPServer
Then go to
http://localhost:8000
I don't think extensions are allowed to run on file:: urls because then an extension could read your hard drive.
If you are doing video or audio then try this node server.
I just downloaded WebGL Inspector 1.13, and it has a setting (under Settings>Extensions>WebGL Inspector) that reads "Allow access to file URLs". Does what it sounds like - all set!

HTML 5 GeoLocation in Google Chrome

I am using HTML 5 Geolocations API's for tracking location however I am getting the following error on the Geolocation icon in Chrome Browser
"This Page has been blocked from tracking your Location"
I went to the Preferences and Setting's Page but did not find any help.
In my case the problem was that I opened the HTML file from the file system (file:///...). Browsers generally try to prevent accessing personal information (which includes location) from local files, so you have to serve the file through a web server (even if it is local).
One simple way to serve a static website located in your filesystem is SimpleHTTPServer if you have Python installed. Just navigate to the folder using the command prompt, and say python -m SimpleHTTPServer, and then you can view the file on localhost:8000.
Even I was facing the same problem. One of the solution is to open to file in another browser, I tried in Firefox and it worked fine. Another solution is to open the file through your WAMP server (Local host).
There is a good article here about Geolocation API. You have to go to chrome://settings/content and there, you can find Location information. You should be able to find the exceptions and manage them there.