Electron/Chromium: how to set about:flags value with command line? - command-line

I know that I can toggle lazy image loading by loading URL chrome://flags/#enable-lazy-image-loading and pressing the toggle. Is there a way to pass the required value (true or false) using command line flags?
I'm currently trying to figure out this for an Electron app but I would like to find a more generic solution. If a single command line option would work for Electron, Chromium and Google Chrome, it would be perfect.

Related

flutter emulate shell window with xterm

I am making an ssh function in my project. (with https://pub.dartlang.org/packages/ssh), right now session is connected with xterm, cmd can be expected, and the result from the ssh server is displayed in a Text widget, which will have the string like '[0m ... [0m', if I print the result into the console(print(result)), it will display correctly with the color specified, so how can I emulate a shell window which displays the result correctly in my app?
The output of the app now
Output in console which I want to emulate in my app
another example of cmd 'top' in app
output in console that i want to realize
Well, the weird [0 you see are ANSI escape codes. These codes tell the terminal that a certain part of a string needs to get a color. You can find a list of colors here: https://en.wikipedia.org/wiki/ANSI_escape_code#Colors.
Then when you have that info, you will need some tool that can style parts of a TextField. In Flutter you can use the RichText class: https://docs.flutter.io/flutter/widgets/RichText-class.html. My suggestion is to do a find and replace on the text you are showing.
References:
Display a few words in different colors in Flutter
How to change the output color of echo in Linux

Open standalone player directly from command line without configuration popup

Using windows 7 and unity 5.3, I want to open the player without the first popup which ask about configuration Like screen resolution and graphic quality etc as mention in Picture.
I want to open the scene directly but these configuration I want to provide through command line and batch file. I checked Unity docs about command line but it did not work for me I tried this command line but still showing the popup.
E:\Player\StreamerPlayer.exe -screen-width 800 -screen-height 600 -screen-quality fantastic
Is there any way available to play standalone from command line and provide all parameter thought it and open scene directly?
Go to File/Build Settings/Player Settings and then check out the Standalone Player Options where you set the Display Resolution Dialog to Disabled.

How to call function on js object from chrome dev tools?

Say I want to look at an object and so I log it to the console:
console.log(theNoticeObj);
Then using Chrome Dev Tools, I inspect it in the console and change its property theNoticeObj.bounceHeight to 10px
Now if I want to trigger theNoticeObj.bounce() on that object immediately to locate it, is there an easy way to do that from the console?
Thanks
EDIT:
Breakpoints where suggested below, but this freezes execution.
In face what I want is the command line API to work with javascript objects, not just DOM elements. If that were possible I'm sure I would be able to find it. I might go and see if there are any feature requests to that end for chrome.
https://developers.google.com/chrome-developer-tools/docs/console#using_the_command_line_api
Try adding window.tno = theNoticeObject under the console.log statement. Reload the page and see if you can execute tno.bounce() from the console. If theNoticeObject is still in scope, this should work.
You can navigate to the Sources tab and open your javascript file containing the piece of code you want to play with, in this case let us assume it is
console.log(theNoticeObj);
Once you find this line, you can set a breakpoint at this point and when your program execution comes to this line it will halt.
You can then use the Console tab to do operations on all the javascript objects in current local scope, window scope. You can simply call:
theNoticeObj.bounce();
It executes in the current context reflecting changes on the screen.
Hope this helps.
Now you can right click any object in the console and use "Store as global variable".
A new console line appears with the name of a new global variable holding reference to the selected object.

NoMethod Error for window.use on tabs

I'm prototyping a script in irb and I'm running into a NoMethod error for '.use' when using the window switching api on tabs. Anything as simple as
b.windows.last.use
b.windows[2].use
Will not be respected and throw aNoMethodError: undefined method 'use' for nil:NilClass error while the window remains tabbed. If I drag the tab out to a separate window and run the same command it works as expected. Is this a known issue?
Please make sure the window you want to use is a real a new window of browser, not a tab, than you can use these methods described in this spec.I am not sure webdriver supports capturing a tab as a browser.

Is it possible to move the command prompt to a certain position on the screen?

As the title says, is it possible? I've searched all over the internet in order to find it, but whatever variation of my search query I come up with, I end up getting results which are about the move command which is used to move files/folders, instead of the actual prompt.
When doing
mode /?
The only result I can remotely relate to the appearance of the prompt is the Display mode,
(mode con:cols=x lines=y)
As I've said, I can't find any documentation about this & I'm extremely curious, can it be done? I know it can be done in Visual Studio to set a position where it should show it's dialog, so I'm presuming it can be done...
PS: If it can be done, what value should I use to have it perfectly centered when using these size settings?
mode con:cols=50 lines=15
Thank you in advance.
Yorrick
You cannot do so directly from a batch file. However, you can write a small program to do that. The relevant Windows API function is MoveWindow.