Save console output in Chrome - google-chrome

How do you save JavaScript console output in Chrome across page loads? The output is cleared when you navigate away from a page, so if you have messages logged just before the new page is loaded, it's difficult to see them before they are cleared.

Right click on the log/console area and check the "Preserve log" option.

Related

Why chrome shows alert randomly when try to open custom protocol url with location.href?

i had took a look to another threads about chrome and custom protocol apps, but i couldn't resolve a doubt i've got. In my web app, when you click a button it fire a new tab with an webpage (window.open(url, "_blank")). The new tab is opened with the url (annother web app with https protocol). This url fire a javascript function on load that verifies some things and then generate a custom url, for example myurl://base64code, and put it in an existing iframe in this way windows.frames['myframe'].location.href=theCustomProtocolUrl. i tried in different ways (location.replace, create a new iframe and set the url, etc) and i always have the same problem. If i refresh (ctrl f5) the page it always show the dialog or if i open the link with the developer console opened. But if i click my button and the page is opened in a new tab it doesn't work only if i refresh (ctrl+f5). This works perfectly on IE11, it launch the app directly.
Any ideas why chrome, and edge, works like this?
UPDATE: I have found the reason, is i use the protocolcheck.js (https://gist.github.com/vladimirtsyupko/cfcd332476b16683bb0b) library.
First i tried to open a protocol with the timeoutHack (it use blur event) and then, after failing, it fires the other url (in this case https) and the dialog doensn't appear. I found a bug with blur event on chrome > 85 https://bugs.chromium.org/p/chromium/issues/detail?id=1137801
Thanks in advance

Is there a way to make chrome devtools undetectable?

I want to see how stuff works on a website, but each time I open Devtools (or refresh the page), I get an alert saying Devtools is open. It blocked me from using Devtools, so I want to disable this feature.
So, I searched how to "jam" google chrome Devtools and got these results:
Find out whether Chrome console is open
https://coderwall.com/p/iktwug/detect-if-chrome-devtools-are-open
https://github.com/sindresorhus/devtools-detect
But I can't find any information about making Devtools Undetectable or disabling this code. Tried undocking Devtools, didn't work.
This is their code blocking me from using Devtools:
https://hastebin.com/oxopowiduy.php
What should I do to make Devtools Undetectable?
In Chrome 73+ it's possible to open devtools before the page can run any code to detect it:
open chrome://inspect
click "Pages"
click "pause" on an entry for the tab you want to debug
Now you can inspect the page, find out how exactly it detects devtools, and defuse it. Judging by the code in your question, you can run window.uomg.create.onchange = null, but if not, set breakpoints in the code and debug it to find out a working method.
Based on this answer:
Find out whether Chrome console is open
The answer to your question is "No" - the sites are probably using jscript to detect the console is open and you will not be able to send back a false negative.

Chrome's DevTools console scroll

I would like to save my Chrome's DevTools console history.
I know I can right-click "Save log as", but this only goes to up to the last clear.
I could just never clear console, but then I'm annoyingly stuck working off the bottom of the screen.
Is there anyway to scroll the console screen?
You can't but there is a filter field top of the console, just put some random text in it, and it is hide all the logs for you.

Chrome devtools extension to capture HAR

Trying to make an extension to capture and store chrome HAR.
Intent: extension has a popup html page with start and stop buttons. Capture all network requests of the current tab between clicking of start and stop button.
Problem: since chrome.devtools.* are only available to devtools_page, how am I supposed to send event (clicking of buttons) from popup page to the devtools page.
Read that the background page is responsible for communication between several parts of the extension. Not able to understand how that can be used here.

Google Chrome source code reloading

How do I reload a page in Google Chrome, so the source code will not change?
In other words, if I change some text on the page with developer tools, and reload the page it loads the source code from the server. How can I reload the page so it will keep my previous changes I made?
To be more specific:
I enter a page
I edit content with Developer Tools
I press reload
I get the original version
As far as I know I must forbid Google Chrome to download source code from server or load a cached version, but how I to do that?
As far as i know isnt this possible, because when you press reload, Chrome automatically "deletes" your webpage that is shown at the moment and gets the source from the server again. You could try to save your changed webpage in the cache of a proxy server and then get it from there.