How do I tell figwheel to start and connect to Google Chrome instead of Firefox? - configuration

I'm taking some baby steps with figwheel.
When I fire up the tutorial application, it starts firefox, which then connects back to the figwheel process to get code to run on its JavaScript engine. If firefox is already running, a new tab is opened and the connection proceeds likewise. Figwheel probably just executes the firefox command with appropriate options. Or maybe it is using xdg-open.
The system is a Fedora Linux with KDE. Interestingly a "default browser" is not currently configured (how to configure the default browser is described in these KDE help pages): the application to start is selected based on URL contents. So I am not sure why figwheel selects firefox instead of Google Chrome, also installed.
Now, for testing purposes I sometimes want figwheeel to use a Google Chrome process instead. Is there a way to do that?
There seems to be no option regarding this.

You can use figwheel's :launch-js option to define what action should be taken for example:
:launch-js ["chrome" "--repl" :open-url]

Related

RenderDoc inject into Google chrome failing

Hi so I am trying to start chrome with white tab(no graphical api) following this Google maps to 3D model tutorial and part of it instructs to inject RenderDoc into Google chrome but the injection is failing
I'm suspecting that this is what is causing the injection to fail is that chrome is loading with graphical api involved:
I made a shortcut with Target in properties holding" C:\Windows\System32\cmd.exe /c "SET RENDERDOC_HOOK_EGL=0 && START "" ^"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe^" --no-sandbox --gpu-startup-dialog""
Using it opens this
But it should be like this
And can inject into it
But when I click the ok button in the pop up "GPU starts with pid: 2408" puts me out and when I try to reinject does this
Any idea how I can fix this?
Tried different versions of RenderDoc (1.17 and 1.24), running on cmd instead of shortcut and restarting machine.
I'm going crazy with this problem....
Chrome restart several times, before restarting I noticed injection success with upper status bar visible, but when chrome restart last time injection fails.
I suspect that chrome has a system to detect injection and try several methods to block it, until a new restarted gpu process has avoided it.
I'm actually searching in this direction to solve the problem (if I'm right).
Confimation of this : https://www.securityweek.com/chrome-block-apps-injecting-its-processes/
...So I'll try a chrome version before 72 of January 2019, when chrome try to blocks all injections...

How to manually disconnect webpack dev server from chrome

Can I manually disconnect a chrome window from refreshing automatically when I change my code.
Basically I want to disconnect the websocket connection using devtool or some other way. I tried offline checkbox, but its not helping.
This will come handy for a HTML developer for him to compare the HTML changes done from a developer tool and to the original one.
Right-click the WS connection in the Network panel then select Block Request URL. Based on the websocket.org echo demo, it seems to provide the effect you're looking for.
Have you tried setting the hot module reload to false? There is mention of it in the docs.

How to disable Google Chrome source compression "?body=1"?

I'm trying to debug some JavaScript for a Rails project and its incredibly frustrating to go line by line when the source code is compressed in the Sources developer tab.
I know this compression is done by Chrome through the body variable. What I want to know is if there is any way to stop Chrome from compressing files in source view, i.e:
\application.js?body=1 --> \application.js
Thank you for your time.
Compression is being done by Rails. Disable it in your configuration:
# config/production.rb (or whatever environment you're in)
config.assets.compress = false
You might want to investigate a new feature in Chrome called Source Maps.
Source Maps allows Chrome to map the compressed source code it receives to the uncompressed original, which in turn means that you can debug the code, even though it's been compressed.
This feature should help you get around this kind of problem without having to change the compression settings on your server.
You can read more about it here: http://blog.mascaraengine.com/news/2012/4/16/sourcemap-support-in-chrome-greatly-improves-debugging.html
I believe this feature is still in test and not yet in the final release version of Chrome. I'm sure it will arrive in due course, but for the time being you may need to install the "Canary" version of Chrome, ie the pre-release version that includes all the forthcoming features that they're still working on.

Can Google Chrome be made to auto reload after network outage in kiosk scenario?

I have an unattended touch screen kiosk application which needs to be able to automatically reload the browser home page after a network outage has occurred. At the moment the browser will display an "Unable to connect to the internet" error and will wait for a manual reload to be carried out before proceeding. Can this be automated?
I've searched for plugins and have found some plugins which deal with auto-reload but they don't seem to work in this context. I am guessing that the plugin is only active when a page is loaded so in this case with an error condition, perhaps the plugin is not active.
One alternative might be to override the error page which is displayed by Chrome but I don't know if this is possible. I could then instantiate a Javascript timer to try a reload every n seconds for example. Is this possible?
I saw a suggestion to use frames to allow the outer frame (which is never refreshed) to keep trying the loading of an inner frame but I'm not keen to use frames unless there is no alternative. I also saw a suggestion to use AJAX calls to check if the network was working before attempting a page load but this seems overkill if there is a way to correct the error only when it has occurred rather than pre-empt an error for every page load.
Host system is Windows 7 by the way. I'm keen to keep the browser running if possible rather than kill and create a new browser process.
If you don't want to tackle chrome extension development, you could wrap your site in an iframe, and then periodically refresh the iframe from the parent frame. That way you don't need to worry about OS issues.
if the content were loaded from ajax from the start then the it could simply output a custom message on the page as it does a check via AJAX. Probably prevention over remedy is always recommended
Assuming linux, you could create an ifup script to simply relaunch the browser with something like
#!/bin/sh
killall google-chrome
DISPLAY=:0 google-chrome
On debian/ubuntu, edit /etc/network/interfaces to include a post-up line; Google ifupdown for other distros.
On windows, you'd do roughly the same with a PowerShell script.
If you really want the precise behaviour you describe (without restarting the whole browser), I suggest you develop a plugin/extension: http://code.google.com/chrome/extensions/getstarted.html
I know you are using Chrome, but in Firefox this is trivial by overriding the netError.xhtml page to do a setTimeout(location.reload, 10000);.

Automating Google Chrome extension packaging

I'm trying to automate packaging of the Chrome extension on Windows and according to the documentation, it is this command:
[path]\chrome.exe --pack-extension=c:\myext --pack-extension-key=c:\myext.pem --no-message-box
However this command results in a new browser window and no action is performed. I tried other switches like --version or --help but it seems that Chrome is ignoring all of this. Do others have the same issue? What am I doing wrong? I also tried various quoting and with no other browser window open but I haven't been able to make this work.
Update: I'm happy to learn that the new Chrome 8 has fixed this issue.
The answer is present in one of the comments. I am reposting the answer verbatim here:
You can try one of the scripts to pack
an extension at
https://developer.chrome.com/extensions/crx#scripts
– by Na7coldwater
You'll need to close all chrome windows before the command line pack extension command will work.
I raised this bug with the chrome team some time ago (http://code.google.com/p/chromium/issues/detail?id=22901) but it's not quite fixed yet. This can be somewhat frustrating because (as michaelhermannweber pointed out) "Since we're fans of Chrome, obviously Chrome is already open!"
I even tried to use a separate instance of the chrome executable to build the extension, but alas no luck on that front either :(
For now, AFAICT you have to do it manually via the pack extension button on the chrome://extensions page.
You might manage to build a script that closes all open chrome windows, builds the extension, and then re-opens chrome. But I doubt that it would be worth it given the number of tab users like to keep open.