Questions tagged [google-chrome-console]

The Console of the Google Chrome browser is part of it's developer tools and debugger. Use this tag when asking questions about the Console API and it's usage.

Console is an integral part of Javascript debugging when done in Google Chrome. It offers the user a command line interface to execute Javascript expressions. Also it provides a logging interface to programmers who wish to log debug messages while executing a script.

The Console API provides web applications with methods for writing information to the console, creating JavaScript profiles, and initiating a debugging session.

You can find Console API reference here.

144 questions
3
votes
1 answer

How to get 'class' name like Chrome's dev console?

Below is a piece of code evaluated in Chrome's console. A function constructor is created anonymously and used to construct an object. Chrome happily prints the real constructor's name 'Foo'. But, I can't find a way to get it using standard JS.…
IttayD
  • 28,271
  • 28
  • 124
  • 178
3
votes
0 answers

How to change order of javascript context in console window in Chrome browser

I am working on a tool that has its own debugger. I can select it from the drop-down option in the javascript context in the Chrome console window as shown in the following image. So, every time I refresh the chrome page, this option resets to…
3
votes
1 answer

Javascript let double declaration

I know let in JS cannot be declared the variable twice. But when I try the below code in my console: a = 1; let a = 2; let a = 3; . . . let a = 100; Note: They are run line by line (as shown in the screenshot below). The version is…
Mark
  • 53
  • 5
3
votes
1 answer

console.dir options parameter

Syntax suggestions in Chrome console show that console.dir has options parameter: But it's not documented, and options from Node.js implementation are irrelevant in this context. Is the mention of options parameter a mistake or something that…
Estus Flask
  • 206,104
  • 70
  • 425
  • 565
3
votes
1 answer

Google Cast iOS SDK button disappear after accepting Local Network Permission

I was trying to implement CAST SDK. My intension and i have done the following things : Casting/Mirroring my app screen. I don't want to play any video , just screen casting of my app to larger TV/screen. I know about Airplay, please discuss on…
Jamshed Alam
  • 12,424
  • 5
  • 26
  • 49
3
votes
1 answer

Get attribute values matching xpath

Consider the following sample HTML: link1 link2 $x('/html/body/a/@href') in the Chrome developer console gives me two…
stefan.at.kotlin
  • 15,347
  • 38
  • 147
  • 270
3
votes
1 answer

Use all of the requests to answer available at once on a question on Quora from the Google Chrome browser console

I often have to click 25 times on the blue button with a plus next to the suggested profiles that might answer the question I'm interested in on Quora. It's boring. What should I put in the google chrome console to automate this process?
3
votes
1 answer

Pause a youtube video from the chrome console after it reaches 3 minutes

I can pause the video with globalThis.ytPlayerUtilsVideoTagPoolInstance.l[0].pause() I can get the current time of the video with globalThis.ytPlayerUtilsVideoTagPoolInstance.l[0].currentTime How do I trigger the pause automatically when the video…
3
votes
1 answer

How to provide styled text in console

If one goes to Facebook and opens the console they'll see input such as this: How does Facebook achieve this styled text? Also, unlike a normal console.log, etc. there is no script.js:123 reference in the console. This is Chrome 56.
Mooseman
  • 18,763
  • 14
  • 70
  • 93
2
votes
0 answers

concatenation of request url to web archive's base url when using fetch api

I want to run some script from the browser console for external sites that extracts the dom tree with some format, I did it right but when I wanted to write the result in my file system. this was not allowed due to security issues, so I wrote a…
2
votes
1 answer

Using JSX inside Chrome Console (to test jsx/react quickly on any webpage)

I would like to be able to use JSX (with react) within chrome console on any webpage in order to quickly create and test jsx react components on any webpage. This is helpful for me because I have chrome UI extensions ideas that I want to test…
Omar
  • 6,681
  • 5
  • 21
  • 36
2
votes
1 answer

Error with Permissions-Policy header: Unrecognized feature: 'interest-cohort'. Error while trying to add an ID attribute to a button JavaScript

So, I wanted to execute some JavaScript into my Android app that is in Java, but when testing the JavaScript that has to run; in the Chrome Console (Ctrl-Shift-J), I get the following error: Error with Permissions-Policy header: Unrecognized…
2
votes
0 answers

Replacing cookies in google chrome

I've seen that you can replace cookies file (C:\Users\USERNAME\AppData\Local\Google\Chrome\User Data\Default\Cookies) and change the set of logged in accounts in chrome. I was wondering if it's possible to do it in browser using console. So far I've…
2
votes
1 answer

Blazor, Debug.WriteLine not outputting to Google Chrome Console

When my Blazor WASM project was using .net core project 3.1, Debug.WriteLine("test") would output to Chromes console window. After upgrading everything to .net core 5.0.301 Nothing is output. I get this error show in the Visual Studio to debug…
ca53rlb
  • 77
  • 5
2
votes
1 answer

Why does chrome console gives a different result between {} + {} and {} + {};

If I type in Chrome console {} + {} I get "[object Object][object Object]" but if I add a semicolon the result is different: {} + {}; I get NaN I don't understand the difference though. First one makes sense, to me as the addition operator rules are…
1
2
3
9 10