The details of this issue are quite complex and confusing, but I will try to explain as clearly as I can.
I have written an app using NWJS which uses an iframe within which I am loading the web page generated by similar devices (surveillance cameras) on my local network, using ip addresses (192.168.1.252 and 192.168.1.245). One device is newer than the other.
I am able to access the older camera just fine using the url http:/192.168.1.252/ in the src attribute of the iframe.
However, I am unable to access the newer camera this way (http:192.168.1.245/), and get a "Page not found" error. BUT, I can access either camera just fine in Firefox using the ip address. HOWEVER, in Chrome, I can only access the older camera; the newer one gives me a "connection not private ... NET::ERR_CERT_AUTHORITY_INVALID" error.
I found this question on SO that is related, which talked about things getting screwed up due to redirection: HTTPS iframe inside a HTTPS page not working . In Firefox (where I can access both devices) I observe that in both cases, the url redirects to an https url. Based on the advice given in the SO question, for both urls, I have tried using various combinations in the src attribute of the iframe:
(What is really interesting to me, only http://... in src attribute the will work for the older device; if I use https://... (the protocol it gets redirected to when it works in the browser) I get "page not found". I don't know if this bit on information is helpful or more of a diversion.)
There is nothing that indicates this is a cross-origin issue, and there shouldn't be as I am using the nwfaketop nwdisable attributes as talked about on this page: Avoid iframe-busting with nwdisable and nwfaketop? .
The HTML in the NWJS app is as follows:
<!doctype HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>ReolinkNWJS_TEST</title>
</head>
<body>
<iframe id="reolink_page" src="http://192.168.1.245/" nwfaketop nwdisable>
</iframe>
</body>
</html>
package.json:
{
"name": "ReolinkNWJS_TEST",
"description": "TEST",
"version": "0.0.1",
"icon": "icons/app.icns",
"main": "html/main.html",
"chromium-args": "--enable-logging=stderr --enable-spell-checking",
"window": {
"toolbar": false,
"width": 800,
"height": 500,
"position": "center"
},
"nodejs": true,
"node-remote": "*://*",
"scripts": {
"prod": "nwbuild --platforms win64 --buildDir dist/ ./"
},
"devDependencies": {
"nw": "^0.12.0",
"nw-builder": "^3.7.0"
}
}
I'll update with any other code if needed.