If I visit a site, I want to close the Chrome Web Browser. Is it possible to write such a program?
Under normal operation, this should not be possible. However, there have been cases where browsers have had well known bugs that could be exploited. To be clear though, I'm referring to crashing the browser. There is no supported API or method of asking the browser to close.
For instance, a simple line of CSS could crash Internet Explorer 6. Something like this on Chrome would probably not work anyways, since Chrome runs each tab in its own process.
There is a way to close a browser window (tab) via script if your script opened the window, simply by calling window.close() (where window is the child window). Please see https://developer.mozilla.org/en-US/docs/Web/API/Window/close for more information.
Related
Sinсe Google Chrome was updated to 50.x version, it become impossible to work with DevTools. This issue reproduced mostly in "Network" tab. Every time when you click on "request" it takes about 30-40 sec. after that chrome can crash. Tried to delete all extensions, clear cache, and reinstall, but didn't help. Does anybody know how to fix this issue?
I'm running Chrome 50.0.2661.87 m
UPD: The problem may be occurs because of long headers. Try to close response and request headers.
I've been having similar issues for debugging in Chrome versions 50+ on Mac OS X 10.11.3. The only solution I've found so far is to keep the dev tools docked to the right and it seems to be as performant as before. Not the optimal solution, but it works in my case.
Finally, a solution has been found which helped me after such a long time and after so many failed attempts to fix it: Solution on Google Chrome Forums
Go to chrome://flags/#force-color-profile
Change it to sRGB
Since Google does not allow direct links to chrome:// you'll have to insert the colon by yourself, or enter the whole link manually into your toolbar.
My situation was similar, after struggling a while with extreme slow developer tools response I found out the problem was caused by a Chrome extension I had installed for knockoutJs.
So for people experiencing these issues, as part of the initial troubleshooting, try disabling chrome extensions.
I'm using the Version 61.0.3163.79 and I have the same issue that this post talks about.
With some searches I found out that the problem was in the user that I was using. What I tried was to enter int google chrome as guest and the devtools became faster again.
So what I did was:
Check out if debugging using the guest user is faster as it should be.
Logout from the account.
Clean all cache associated to google chrome.
Restart the PC (but i think closing the browser is enough)
Login again in your account.
I hope this could help other people with same problem.
[EDIT:]
I found out that after some time (weeks) the google chrome dev tools will get slower again. So I tried the following solution and it worked:
Open the dev tools
Go to the Sources tab.
Cleaned all watched variables, breakpoints, DOM breakpoint and Event Listeners breakpoint.
[SECOND EDIT:]
After some weeks, the issue came again. What I did was installing the google canary Version 64.0.3249.2 canary (64-bit) and my problems vanished.
For who's that doesn't know what is canary, please check this link.
Google is aware of the problem - https://bugs.chromium.org/p/chromium/issues/detail?id=624097
The problem seems to have vanished in v.53 - they are currently trying to figure out what fixed it. If possible, the fix will be merged back to v.52. But at least they are working on it.
In case others arrive here facing the same issue I had, try changing the Dev tools tab you're looking at to Elements.
I had the "Sources" tab open and Chrome was trying to load enormous assets for that tab, which created a multisecond delay between the console.log() events I created and the display of those logged messages.
Make devtools snappy again by deactivating all breakpoints:
Go to the Sources tab, show the debugger (may be hidden) and hit Deactivate breakpoints.
(Chrome v62.0 on Windows 10)
I've had the same time issue on 54.0.2840.99 m version of Google Chrome.
But switching to Chrome Canary worked !
Reduce size of resource being overridden
Only overriding files with less lines of code worked well for me. I landed here because I was overriding a file which had 35,000 + lines of Javascript.
Further, if your resource is a new one - i.e. it is not included in a script tag or link tag, you can override main html document and add the tag : <script src="/my-new-script.js"></script>. Add the file to your domain-root within the Overrides folder on Chrome:
overriding HTML
then overriding CUSTOM SCRIPT:
Good Luck...
I also face same issue.
I tried unchecked toggle screencast. Now it is working fine.
In my case, I had Local Overrides setup (https://developers.google.com/web/updates/2018/01/devtools#overrides) in Downloads folder which had a lot of files in it and that slowed down devtools.
Setting up overrides in its own seprate directory fixed the slowness.
I sped up Chrome again by doing the following:
Open DevTools -> select Elements tab ->
select nested Computed tab -> under Filter, make sure that Show all is unselected.
select nested Event Listeners tab -> make sure that Ancestors and Framework listeners are unselected.
For me, running Chrome Version 81.0.4044.138 (Official Build) (64-bit) on Ubuntu 18, the problem seems to be the mobile view. When I disable mobile view inspecting becomes really fast again. I think it is caused by touch emulation and other mobile stuff.
To have something similar to a mobile view I move the DevTools dock to the side and resize it until I get the width I need. It is not perfect, but it is useful most of the time.
Besides Chrome, Firefox is much faster when inspecting sites overall, though I didn't use FF because I'm used to specific things on Chrome. Moreover, most of the sites I work with do not trigger these issues on Chrome, in fact, it happens with only one site.
PD: the site that triggers the issue on Chrome Dev Tools has lots of CSS variables. Not sure if that is related.
UPDATE 1 WEEK ago
I was able to use Chrome without issues even in the mobile view by disabling the option "Show media queries"
Go to the network tool and change it without any restrictions. Sometimes this happens if you change mobile settings. Google chrome changes this setting to test mobile device on low internet connection and leaves it that way.
I am experiencing an issue with opening a Microsoft Office Document, using IT Hit WebDAV AJAX library, in latest Chrome 39.0. running on Windows OS. It is a sporadic issue that occurs only in Chrome, and it happens when one opens a document multiple times. Word instance won't start, the page freezes and browser becomes unresponsive, and Chrome suggests killing the page. The only solution is restarting the browser, which solves the issue.
I have tried opening a document in Chrome on Mac OS X, and it is working fine. So are Mozilla and Safari on all operating systems. It seems to be a Chrome + Windows issue only.
Has anyone experienced this issue and is there a fix?
The Microsoft Office plug-in that opens the document displays a warning popup "Some files can harm your computer.", which is a modeless dialog:
If you quickly click on a link that opens the document more than one time the dialog will hide behind the main web browser window. As a result the web browser window is blocked.
You need to switch to that dialog and confirm or reject document opening, otherwise after some time Chrome will ask you if to kill the page or wait.
Note that there is no way to avoid that dialog, this is a built-in MS Office functionality as far as I know.
Chrome will only work good with ITHitWebDAV if the user has got Office 2013 or superior.
Google is blocking all Java applets and NPAPIs now, so good luck with that. I just detect the browser of the user that wants to edit a document, and if it's chrome, I warn him to change to another browser like Firefox with a modal, and that's all.
Very poor support between Chrome and ITHitWebDAV, and no much you can do about it.
When Chrome stops WebGL and gives you the following error (in a yellow banner on top of the screen): "Rats! WebGL hit a snag...", and reloading does not work (WebGL is still not re-enabled), is it possible to re-enable WebGL without restarting Chrome?
Context:
Chrome disables WebGL probably because it requires too many resources: I ask it to display 400,000 billboards on Cesium, for those who know what this is.
I know how I could reduce the resources my app asks for, but actually I am exploring its limits for testing purposes. So I am going to make Chrome disable WebGL a lot of times, and I do not want to restart it everytime it disables WebGL.
My configuration:
Chrome 35.0.1916.114 m
Windows 7 Pro 64 bit.
Solutions explored:
I already tried to open a new Chrome window, it does not work. For the moment all I can do is close all Chrome windows and restart it.
I already tried to put --ignore-gpu-blacklist in the Chrome shortcut (even if I understood this is for Windows XP, right?).
Hope I was clear enough.
Thank you for your help.
I was having the same problem and I just found a solution. It sounds like this didn't work back when this question was posted but, it works now!
Refreshing the page doesn't work. If you clicked a link from a different tab to open the tab the crashed, clicking that link again doesn't work. You have to open a new tab and paste in the URL of the page that you want to reload.
I'm guessing this is due to chrome threading... by opening a brand new tab, you create a new thread instead of using the existing one.
In your application you should properly handle webglcontextlost and webglcontextrestored events. In particular, you should prevent default event action in webglcontextlost handler thus telling the browser that you can restore proper functioning of your app when webglcontextrestored will be fired.
This is a question about debugging a project, not about writing the code.
I am on the final stages of developing an HTML5 web app. Fairly last minute, our client tells us it should run on IE8. Since I use the HTML5-canvas in the app, this required the addition of Google Chrome Frame. Once installed and testing, however, IE8's developer console no longer prints any data, and the HTML viewer never loads. Is this a bug? Is there a way to fix it? It will really suck if I need to debug with alerts...
From Google Chrome Frame documentation:
You can use the Web Inspector in GCF just as you would in the Google Chrome browser. To use it, right-click and choose "Inspect Element". Logging is available via the console.log method, and you can set breakpoints and inspect network activity.
<a href="http://192.168.1.1"
onclick="Popup=window.open('http://192.168.1.1','Popup','toolbar=no,location=no,directories=
no,status=no,menubar=no,scrollbars=yes,resizable=no,width=800,height=300,left=300,top=23');
return false;" >
<button type="button">button</button></a>
If i'm browser this page in firefox, it pop up a new window in firefox when i click button.
if in chrome, then it pop up in chrome.
What if i want the pop up window always open in IE even when im browser this page in other browser?
Thanks!
Browsers cannot start other programs except with a plugin installed.
You can't do this. It breaks the sandbox model -- javascript in chrome, firefox, etc., executes in a security sandbox and there are lots of things it can't do. It can't save files to your hard disk (malicious code could overwrite your OS) -- it can't open arbitrary executables or start processes (malicious code could run a virus/malware). Javascript doesn't have the ability to do this.
As mentioned, browsers cannot start other programs without plugins or similar functionality.
I think your best bet is to detect IE on the other page. I don't believe there's a way to force IE. You could provide the link for them to easily copy and paste into IE, such as in a text box that is fully selected when they click in it.