Remote Debug "Chrome Mobile" to "PC" - google-chrome

I want to inspect and debug a Chrome Mobile application on my "chrome pc/machine",
so I've followed [this](http:// eveloper.chrome.com/devtools/docs/remote-debugging-legacy
) Google tutorial.
When I acessed localhost:9222, it lists the correct sites opened on my android chrome.
But the following error occurs when I click on "Inspectable pages". The console show the message
Document was loaded from Application Cache with manifest https://chrome-devtools-frontend.appspot.com/serve_rev/#178678/178678.manifest
Application Cache Checking event
[blocked] The page at 'https://chrome-devtools-frontend.appspot.com/serve_rev/#178678/devtools.html?ws=localhost:9222/devtools/page/0' was loaded over HTTPS, but ran insecure content from 'ws://<localhost>:9222/devtools/page/0': this content should also be loaded over HTTPS.
Uncaught SecurityError: Failed to construct 'WebSocket': An insecure WebSocket connection may not be initiated from a page loaded over HTTPS.

I encountered this problem too.
According to this report Chromium Issue 398817, you can add the --allow-running-insecure-content when launching Chrome.
This worked for me on Windows 7.

Related

Stop browser from requesting service-worker.js from server

On a former project I was working on there was a manifest.json file while allowed the app to be a progressive web application.
However even now on different projects I can see that my browser is requesting the service-worker.js file from the backend ie:
GET /service-worker.js 404 557.926 ms
How can I turn this off within my browser so I don't see these errant logs come through my app?
You need to unregister the service worker like such:
https://www.codementor.io/#himank/how-to-unregister-service-workers-n8mzf5jce
In case the link should stop working, these are the steps for Chrome.
open the dev console
click "Application" tab
click "Service Workers"
click "Unregister"

IntelliJ IDEA and Google Chrome fail to connect for JavaScript debugging

JetBrains IntelliJ IDEA sometimes loses its own JetBrains IDE Support plugin in Chrome. Upon debugging in IDEA, Chrome complains that:
hmhgeddbohgjknpmjagkdomcpobmllji is blocked
Requests to the server have been blocked by an extension
and stays on this page:
chrome-extension://hmhgeddbohgjknpmjagkdomcpobmllji/loading.html?__QUERY__
Where hmhgeddbohgjknpmjagkdomcpobmllji is JetBrains' plugin ID.
Instead of redirecting to the target page of the form:
http://localhost:63342/__PROJECT__/__PATH__/index.html
Restarting Google Chrome or disabling-and-enabling IDE Support plugin helps. IDEA "finds" Chrome again and Debug workflow works as intended.
Another possible problem is a failed authorization.
To debug a URL like this:
http://localhost:63342/__PROJECT__/__PATH__/index.html
Open it in the browser before starting to debug. It'll give 404 Not Found. Then switch back to IDEA and it will offer you to Copy authorization URL to clipboard:
http://localhost:63342/__PROJECT__/__PATH__/index.html?_ijt=__KEY__
Open this URL.
After this manual authentication is complete, IntelliJ IDEA should be able to debug index.html in Chrome.
IDEA always opens index.html for debugging in the browser window where the latest authentication happened. E.g., in a Chrome Incognito window, instead of a Chrome "normal" window, if you've just authorized IDEA in Incognito.
Going incognito may require an additional setup:
https://intellij-support.jetbrains.com/hc/en-us/community/posts/206201319-launching-chrome-incognito-in-intellij-12

Easyrtc permission denied and usermedia failed

I am using hublin. the camera and microphone was working fine locally but when i uploaded to server. camera permission pop does not appear, it just silently fails and at console there is error of
easyrtc.js:2100 invoking error callback PermissionDeniedError
easyrtc.js:2085 getusermedia failed
The problem is both with chrome and chromium however asking permission at firefox.
Also i tried to give permission manually but there is no cam-cross icon in rightcorner. In chrome settings>advanced settings>content-settings>camera>manage-exceptions there is no way to manually add specific url for allowing permission as in firefox.
Using of HTTPS for WebRTC applications is mandatory in Chrome. So, it just doesn't show permission dialog when working on a plain HTTP.
Hence, you should configure secure HTTP (HTTPS) on the web server (you can use certificates from LetsEncrypt - work like a charm). Or you can try to use some tricks/workarounds described in this article: https://webrtchacks.com/chrome-secure-origin-https/

d3 map only works in Firefox

So, I have a map in d3 and it is only working in Firefox. It does not work in chrome. When I run the map from pre-pros, it works - I'm not sure how prepros works but it seems to deploy a faux server on my local machine. So with Prepros, regardless of the browser, everything works correctly. Without running my website on prepros, here are some of the errors- what should I do to ensure cross browser compatibility? Thanks.
//Some of the errors
file:///C:/Users/SXM274/My_Websites/Residents_Website/lib/d3.min.js Failed to load resource: net::ERR_FILE_NOT_FOUND
main2.js:11 initialized
main2.js:37 setting map
d3.v3.js:444 XMLHttpRequest cannot load file:///C:/Users/SXM274/My_Websites/Residents_Website/data/countries.topojson. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.xhr.send # d3.v3.js:444
main2.js:87 callback funtion initialized
main2.js:90 Uncaught TypeError: Cannot read property 'objects' of undefined
You can't load local file system resources using XMLHttpRequest for security reasons. You need to run a web server so that the Access-Control-Allow-Origin header can be sent as a response.
You can get around this locally by passing the --allow-file-access-from-files flag to Chrome.
Windows:
chrome.exe --allow-file-access-from-files
Mac:
open /Applications/Google\ Chrome.app/ --args --allow-file-access-from-files

After disabling web security I still cannot overcome same origin policy

I am using google chrome version 43.0.2357.81 on OS X and attempting to display a webpage within an iframe.
ie:
I followed this link with instructions to disable web security and found it helpful for displaying local files within iframes but I am still encountering the same origin error when trying to display disparate web pages.
Disable same origin policy in Chrome
I ran the command open -a Google\ Chrome --args --disable-web-security in terminal and received the banner message confirming that it worked:
You are using an unsupported command-line flag: --disable-web-security. Stability and security will suffer.
However when I view my webpage in chrome I still got a same origin error and was unable to view the site within the iframe.
This has nothing to do with Chrome itself; the server you call within the iframe sends back a http header with
X-Frame-Options SAMEORIGIN
setting. Even "chrome.exe --user-data-dir=c:\tmp\chrome2 --allow-file-access-from-files --disable-web-security" does not disable the iframe same origin check in Chrome. The only option you have is to switch the X-Frame-Options of your server to
X-Frame-Options ALLOWALL
(if you can).