Google Chrome JavaScript Debugger keybindings? - google-chrome

I am using Chrome's JavaScript debugger to work on my code, but I am finding it very inconvenient to constantly move my mouse over to the Go, Step Over and Step In buttons. I find it much easier to hit a function key, like I would in Visual Studio or most graphical debuggers really, do perform those actions.
I can not find any documentation to suggest that such keybindings are available, but I can scarcely believe that such crucial functionality would be over-looked by the Chromium team.
Can anyone offer any help or insight?

If you press F1 while in the debugger, you can see a list of shortcuts.
Examples:
- F8 or <Ctrl>+/ : Continue
- F10 or <Ctrl>+' : Step over
- F11 or <Ctrl>+; : Step into
- <Shift>+F11 or <Ctrl>+<Shift>+; : Step out
- <Ctrl>+G : Go to Line

I believe this is what you are looking for http://trac.webkit.org/wiki/WebInspector

Ctrl + Shift + J for Javascript debugger. Is that the tool you are looking for? Very handy :)
ohh, and for step functions, F10 for step over, F11 is step into. Same as the VS keys, except F5 refreshes the page.

Related

How to run c++ in vscode

I cannot for the life of me figure out how to run and debug a c++ file in vscode. There are always at least one or two things wrong.
I've already used the basic tutorials, but they don't seem to work for me.
Can someone explain it to me like I am 5 years old? Or point me in the direction of a place that will? I am totally burnt out and feel like a total dunce. I can't get a hello world program running and it is driving me crazy. Any help would be appreciated.
Is it on Windows or Linux ?
If on windows, first download and install the mingw setup. You can find it here :
https://sourceforge.net/projects/mingw/
After installation, add the location of th bin of g++ to PATH so that you can access it via the command line.
You can also add some extensions to your VS Code to make debugging C++ code easier, then in VS Code, open the terminal, and , while in the directory where you have your cpp file, simply do a g++ filename.cpp to compile, then run the executable, a.exe, unless otherwise specified in the previous command .
Hope this helps
Make sure that you have c++ compiler I prefer mingw.
Open vscode and go to Extensions or by keyboard shortcut ctrl + shift + x.
Search for .run and install
Search for C/C++ and install.
Go to settings ctrl + ,
By GUI
In the search bar, search for code runner and Code-runner: Run In Terminal will be unticked by default. You tick it and close settings tab. Refer the pic for better understanding.
Finally create a C++ file and save. Go to Terminal and select Run Build Task then click ctrl + alt + n to run the code. Again refer image for better understanding.
This should work, but if still didn't work let me know. Else refer any youtube video , you might have committed small mistake.
Let me know if this didn't work my dear 5 years old guy ;)

Unable to hide “Chrome is being controlled by automated software” infobar within Chrome v76

This is not really a new question, nor an answer to the original question, but is rather a request for clarrity since the answer posted to the original question is incomplete, but any request for clarrity gets deleted...
Original post is here... Unable to hide "Chrome is being controlled by automated software" infobar within Chrome v76
So, while I understand your original answer, we do not use managed instances of Chrome, and we all run on Windows 10 Home Edition... so, this setting your answer is not an option for us. On the other hand, all of our regression tests are failing now because this stupid banner is in the way of everything.
Is there a way a non-IT-Managed user running Windows 10 Home Edition can suppress this banner?
If not, how does Google expect us to continue using Chrome for testing? Any suggestions greatly appreciated... Also, I am using Python, so if you supply code example, please keep that in mind... this is what I am currently doing, and it was working before last week, but not working now...
options = webdriver.ChromeOptions()
options.add_argument('--start-maximized')
options.add_argument("--disable-infobars")
options.add_argument("--disable-extensions")
options.add_argument("--disable-automation")
options.add_argument("--log-level=3")
# options.add_argument('headless')
options.add_argument('window-size=1920x1012')
options.add_experimental_option("prefs", {"download.prompt_for_download": False})
options.add_experimental_option("prefs", {"plugins.plugins_list": [{"enabled": False, "name": "Chrome PDF Viewer"}]})
options.add_experimental_option("prefs", {"download.default_directory": os.path.abspath(context.BaseResultsDir + '/Downloads/')})
options.add_experimental_option("prefs", {"download.extensions_to_open": "applications/pdf"})
context.driver = webdriver.Chrome(chrome_options=options)
After much Googling, this is finally what worked for me... Updated Selenium, switched to Canary release of ChromeDriver, and then made these adjustments to my test code, which is Python...
# options.add_argument("--disable-infobars") <<< TOOK THIS OUT
# options.add_argument("--disable-automation") <<< TOOK THIS OUT
options.add_experimental_option("excludeSwitches", ["enable-automation"]) <<< PUT THIS IN (Finding this one was the real killer)
options.add_experimental_option("useAutomationExtension", False) <<< PUT THIS IN
Your solution and mine are very similar. Thank you for posting.
David
Probably reason behind settings for infobar was working still last week not in this week, are may be you have updated/autoupdated chromedriver or chromebrowser. However your setting to disable infobar are not working because as per this commit on - Jan 10 2018, --disable-infobars option has been removed from chrome options
Solutions - Keeping this line does nothing options.add_argument("--disable-infobars") you can remove it.
options.add_argument("--disable-automation")
This line makes real confusion here towards the solution because there are 2 different ways to do it (By default this switch is enabled we have to remove it to disable the infobar). This line disables the password saving UI for more details read this nice discussion
Use this line do disable the infobar by excluding enable automation switch -
options.add_experimental_option("excludeSwitches" , ["enable-automation"])
It solves the problem to some extent, when I tried with this intermittently developer code plugin popup comes up and ask to enable/disable it. and it wont go away by options.add_argument("--disable-extensions") this. If you facing same issue use another switch to disable it as below-
options.add_experimental_option("excludeSwitches" , ["enable-automation","load-extension"])
This solves the problem from root(load-extension switch supports Chromedriver v2.33 and later). However there is one more way to disable the developer code plugin popup which you can do by adding --disable-plugins into shortcut of chrome
If these solutions doesn't work for you then chromium command line switches here can help you to customize the chrome behavior
Additionaly ChromeDriver(Capabilities capabilities) is deprecated and can be used as
capabilities = DesiredCapabilities.CHROME.copy()
capabilities.update(options.to_capabilities())
driver = webdriver.Chrome(chromedriver, desired_capabilities=capabilities)
solution to disable infobar in Java
options.setExperimentalOption("excludeSwitches", Arrays.asList("enable-automation" , "load-extension"));
will disable infobar with developer code plugin
This worked for me:
options.add_option('excludeSwitches', ['enable-automation'])
Method add_experimental_option, I suppose, is removed from the latest versions.

Live templates in PhpStorm not useful

I installed "Live Templates for Angular" plugin in PhpStorm. I think something is wrong with suggestion (triggered with Ctrl + Space). I have to write whole snippet a-component to get to right suggestion.
Can I improve it somehow in settings?
Here is a gif:
It's because the template name (abbreviation) has a dash - in it ... and when completing IDE treats a and component as separate parts until whole match is found (in case you were doing some subtraction operation with two variables). At very least that's my understanding of this behaviour based on my own usage experience.
You may just change the abbreviation and remove - from there and it will be much better recognized as valid completion item. But that may not be ideal in long run (potentially may have issues when plugin will be updated with new templates etc.)
To bypass it ... just use Live Template specific completion where only Live Templates will be listed. For that invoke shortcut assigned to Code | Insert Live Template... action (Ctrl + J on Windows using Default keymap) at any time when you're typing your Live Template abbreviation.
Please make sure the applicable context yet.
Apply to the specified type of file, or check everywhere.
Like below:

keyboard shortcut in the Command Palette is no longer working

I've installed a Javascript formatter into ST2. For some reason, the keyboard shortcut is not working suddenly. When I search in my keymaps for alt+ctrl+f I don't see anything. How can I figure out why this shortcut is no longer doing anything? You can see the poorly formatted js in the screenshot. If I call the command via Sh+Ctrl+P it works fine. Does the Ctrl+Alt+F on the right side in the screenshot indicate that that command is bound to that shortcut, or just that the package thinks that it is bound to that?
I would suggest you try to use FindKeyConflicts. This plugin will:
Assist in finding key conflicts between various plugins. This plugin
will report back shortcut keys that are mapped to more than one
package. This does not guarantee that the listed plugins are
necessarily in conflict, as details, such as context, are ignored.
This is simply a tool to help assist what plugins may be conflicting.

How to configure FlashDevelop for unit test builds?

I'm using AsUnit for unit-testing my current AS3 project. My Main() is basically:
if ( UnitTest )
runUnitTests();
else
runMainProgram();
where I change UnitTest before building depending on whether I want to run the program or run the unit tests. Is there a way that makes it easier to switch between the two modes?
Optimally, I'd use F5 for building with UnitTest=false and another hotkey for building with UnitTest=false. What is the closest I can get with FlashDevelop?
You can do the following in FlashDevelop
if(CONFIG::debug) {
trace("Debug");
} else if(CONFIG::release) {
trace("Release");
}
These correspond to the drop down in the toolbar next to the play button.
See this link: http://www.flashdevelop.org/wikidocs/index.php?title=AS3_Conditional_Compilation
In terms of the shortcut, just create a macro that switches the release mode then hits play. From there you can add any shortcut you would like to your macro. So one shortcut will launch the course into debug/release mode as required.
Also note, you can have other CONFIG::bla's - so you might want to have CONFIG:unit1, CONFIG:unit2, etc, etc. See above link.
Easy solution:
duplicate the FlashDevelop project file (.as3proj) and name it "MyProject_tests.as3proj",
open this project, create a new ProjectTests class and set it as the main class,
change the output SWF in project settings.
Add another project file. To run the test using it as the primary. "Document class" the context menu on the file.
Like Chris mentioned, you can use FlashDevelop's Compiler Constants to do what you need, though it is a bit cumbersome turning these constants on and off.
However, there is a FlashDevelop plugin called Config::Toggle that makes that significantly quicker by providing an additional panel where you can enable/disable boolean constants with 1 click. The linked website describes the value of the plugin far better than I ever could. Hope that helps.