I have numerous programs that launch the current web browser on constructed HTML files, and it needs to open in a new window. Many places in the registry reference chrome.exe. There are so many it's hit or miss editing each to have "--new-window". I renamed chrome.exe to chrome_original.exe and replaced chrome.exe with a program I made. What my program does is pass command line arguments to chrome_original.exe, adding "--new-window" if not already present. A config file is read for options. For instance I can keep a log of invocations. There are times when adding "--new-window" is not appropriate, which can be determined by examining the log.
On my development machine the strategy works excellent, but on other machines it doesn't. On the other machines chrome loads, but just sits there with the wheel spinning. Does it test to see if the exe being run is chrome.exe? Why does it work on my development machine?
If chrome updates itself with a new version, putting things back like they were, when I redeploy my exe it will take care of that.
I need to get this working if anyone has an idea why chrome will just sit with the wheel spinning and not load a page. Thanks
To analyze the problem I recommend that you install Process Explorer from www.sysinternals.com.
There should be no Chrome "sitting around with the wheel spinning".
In Process Explorer find out which is the process, double click it and in the first tab in the window that opens you see the command line.
Compare it with the command line on the computer where it works.
Process Explorer gives you much more information, like for example the environment variables. I saw in the case of Firefox that Environment variables may be very relevant. For example when you start Firefox by your program and do not set the working directory correctly it may hang.
I resolved my issue. Chrome also runs as a background process, sitting in the tray, utilizing the same exe. When loaded, the exe file is not held open. Having the exe already loaded as one file name, then loading again as a different file name, no doubt causes confusion. What was already loaded needed to be unloaded, first. In addition, the auto start registry key value needed to be updated with the new exe file name.
I have yet to see what will happen when chrome updates itself automatically with a new version. There's a good chance the launching utility will be overwritten. Some tweaking will need to be done.
Using a launcher for chrome to intercept invocations works really well and is a good approach to always having a new window when one is wanted.
Related
I've tried gradlew html:clean and then gradlew html:dist
however, it never uses the newest code. It will continue to grab the code from somewhere else and compile older versions of it. I got it to use the newest code once but I am not sure what I did to get it to do that. I'm not sure what files to post here to help.
For development, there are two ways possible:
If you don't need to debug and did not already compile: Use html:clean and html:superdev and make sure to delete the browser cache => You will get a fresh version of your game
If you need to debug or the game is already running: Use html:superdev if you did not already, head to localhost:8080/html, click the button to enter superdev mode (at the upper left corner) and hit recompile => You will get a fresh version of your game ready for debugging
For releasing an update of your game:
You need to enforce that all users get a fresh copy of your game. You cannot rely on all users deleting their browser cache, therefore you need to use other tricks for that (changing the directory of the game for every build, using HTTP headers...). I recommend you to use game hosting sites like GameJolt ot itch.io. They do this magic for you, and are trusted sites by players.
I found out the answer was to Shift-F5 to hard refresh the page. Chrome was caching the old info.
I am working on a new site and whenever I change CSS settings chrome will not accept those changes unless I close out of chrome completely with Task manager and relaunch it. I have a tried quite a few things. Below is a list of things I've tried:
Versioning the CSS file (I am using a PHP date stamp at the end of the CSS file
Enabling "Clear Cache while developer window is open" in the Developer console
Using Ctrl + F5 to clear cache on refresh
Going to Application and Clear Storage in the developer Console
Clearing Cache folder in local AppData
Deleting CSS file from stie, refreshing, and readding file.
Incognito mode
Adding Launch options to chrome shortcut --disk-cache-dir=null
Adding Browser Plugins to delete cache.
Anyone have any ideas how to help? It is extremely annoying and inefficient to close chrome every time I want to check a CSS change. Another annoyance is that I am trying to listen to music in the browser so if I close chrome I have to go back and get my music playing again and it's just as of now extremely annoying and way more time consuming than I want.
I've tried looking at other articles online about cache busting and other articles on Stack Overflow but I've tried to do most of what they suggest and I haven't seen any positive outcome yet. Most articles say to add some sort of random string or version on the end of the CSS file as a GET request but that isn't working though I know that has worked for me in the past.
pres f12 > f1 > network > disable cache (while DevTools is open). This should solve your problem
Development server was running various caching tools though they should have been turned off. After disabling them chrome started to work better and most of the time CTRL+F5 did the trick.
"clearing cache" is not as easy as it should be. Instead of clearing cache on my browsers, I realized that "touching" the server files cached will actually change the date and time of the source file cached on the server (Tested on Edge, Chrome and Firefox) and most browsers will automatically download the most current fresh copy of whats on your server (code, graphics any multimedia too). I suggest you just copy the most current scripts on the server and "do the touch thing" solution before your program runs, so it will change the date of all your problem files to a most current date and time, then it downloads a fresh copy to your browser:
<?php
touch('/www/sample/file1.css');
touch('/www/sample/file2.css');
touch('/www/sample/file2.css');
?>
then ... the rest of your program...
It took me some time to resolve this issue (as many browsers act differently to different commands, but they all check time of files and compare to your downloaded copy in your browser, if different date and time, will do the refresh), If you can't go the supposed right way, there is always another usable and better solution to it. Best Regards and happy camping. By the way touch(); or alternatives work in many programming languages inclusive in javascript bash sh php and you can include or call them in html.
I used to have the same problem, and I believe it's a (pretty annoying) bug with chrome. You can use the CSS Reloader Chrome Extension to solve it. Not ideal, but better
If you are trying out new CSS updates, I suggest using Chrome's "Inspect" function to dynamically update CSS settings and observe the results interactively. This may save some time during update cycles as compared to manual edits alone.
Another option to try is to define "cache-control" meta tags in your head section. For development/testing, you may want to have no caching. For a real website, you may want to have a shorter age limit. Refer to the following SO Q&A.
Using meta tags to turn of caching in all browsers?
I am doing some web development and am serving some files locally. Now both Chrome and Firefox wont allow me this because of their origin policy. As I prefer Chrome, I chose to to use it in unsafe mode by adding the --disable-web-security flag.
While this works perfectly, there is a slight issue I am facing. I can't run the chrome instance in unsafe mode while my another chrome instance is running in normal mode. If I open new instance by opening the unsafe mode chrome shortcut whilst my regular instance is running, the new instance also opens in regular mode; and vice-versa.
Is there a way to open both simultaneously? If so, how do I achieve this?
PS: I will use two different browsers for this as my last option. I would like to avoid this as far as possible
I found the answer on a Linux SuperUSer forum at
https://superuser.com/questions/593726/is-it-possible-to-run-chrome-with-and-without-web-security-at-the-same-time
I earlier thought this could only be done in Linux but this is also possible in Windows. Essentially we are asking a chrome to create a new instance altogether than sharing the same instance. We do this by giving it a location to store it's data. You can read about this in the above shared link.
I am looking to ungracefully kill a program (Chrome) in Windows 7. Chrome has a read-lock on a .tmp file that I want to make a copy of. If I exit Chrome gracefully Chrome deletes the .tmp file as it exits.
How can I immediately kill the program without letting chrome delete my file?
It probably uses a WinAPI temporary file, so you can't:
Check http://msdn.microsoft.com/en-us/library/windows/desktop/aa363858%28v=vs.85%29.aspx
Specifying the FILE_ATTRIBUTE_TEMPORARY attribute causes file systems to avoid writing data back to mass storage if sufficient cache memory is available, because an application deletes a temporary file after a handle is closed. In that case, the system can entirely avoid writing the data. Although it does not directly control data caching in the same way as the previously mentioned flags, the FILE_ATTRIBUTE_TEMPORARY attribute does tell the system to hold as much as possible in the system cache without writing and therefore may be of concern for certain applications.
You're best best is to try to copy the file while chrome is still running...
Or put a wrapper between chrome and WinAPI to override the CreateFile call so it doesn't create it as a temporary file.
First, in Chrome, use the shortcut key "Shift+Esc" to pop up the Chrome's Task Manager and kill any other processes than "Browser" (the only one that can't be killed using that).
Then, open Windows Task Manager and kill the only one "chrome.exe" that is left behind.
Download a software called unlocker from google.
http://www.filehippo.com/download_unlocker/
Go to start -> search from "chrome" and go the file location. Generally this
C:\Users\\AppData\Local\Google
Right click on google folder and click unlocker. Click all the open handles and then start the chrome. It works!!
Of course the page will be on my pc not from a remote server. I just want to create a launch page for my most used software. I find windows program start menu too much a hassle and cannot find any freeware that does really a good job.
Don't tell it's not possible because I had already done this in the past with javascript referencing a file:/// but I don't remember what's the exact syntax.
Will it work in Google Chrome ?
If you use file:///, then the browser will download the file. Even IE's option of "running" the file is really just downloading it to a temp directory first, then running it. So no browser truly just runs an exe, as browsers weren't designed with that in mind.
You could run a local web server with a little bit of code that does "when user clicks this link, run this program". It would be the web server running the program, not the browser, but it'd have the same effect.