Google Chrome command line switch to emulate a device size? - css

Does anyone know what are the Google Chrome command line switches that I can use to emulate the device size?
The component that I want to test contains the CSS #media query min-device-width/min-device-height. I tried using the --window-size and --user-agent but I have no luck with those.
Basically, I am trying to write a webdriver test for this component.

There are switches which might help you do that --window-size, --user-agent and --use-mobile-user-agent .Here is the full list of switches. This article also explains how to save those settings as a new app.
I was also looking for a way to trigger chrome mobile emulation tool by command line or using webdriver or simply karma, but according to this answer and chromium team there is no such option yet, but a feature request has been filled up you can vote for.

Regular Chrome does not really support this function, but Chrome Canary is exactly what you are looking for.
https://www.google.com/intl/en/chrome/browser/canary.html
https://developers.google.com/chrome-developer-tools/docs/mobile-emulation

Related

Handling variable-fonts when printing a webpage to PDF using Chrome

I'm working on a webpage that has a different "print to PDF" result (after Ctrl+P -> Save to PDF in Chrome) than the original web display by using #media print in the CSS code.
I'm using a variable font with the parameter font-variation-settings:"wght", but the generated PDF seems to ignore this parameter when used in #media print.
Yet, when using the Chrome tool "Inspector>Rendering>Print emulate CSS media type", changes of this parameter are taken into account in the displayed web page!
Looks like the problem comes from the Ctrl+P interface, any ideas on how to handle this?
Thank you in advance.
Please see https://bugs.chromium.org/p/chromium/issues/detail?id=1070089 - this should be fixed now, you may want to retest with a recent Chrome Canary build and see if the issue is indeed gone.

How to unfullscreen a window without notifying it?

I'm trying to enhance the gTile extension by allowing it to resize a fullscreen window to a tiled area of the screen. That's a pretty common thing to do when tiling and it's pretty handy since some windows will hide some chrome when in fullscreen mode. But I'm having the hardest time figuring out how to do that.
Searching the internet led me to this forum post which mentions EWMH and _NET_WM_FULLSCREEN. I've tried to find ways to access window manager hints but can't find anything bashing by head on Looking Glass or scanning through the docs. Is this kind of thing possible through a shell extension?
Meta.Window is likely what you are looking for:
https://gjs-docs.gnome.org/meta4~4_api/
Setting Window.decorated = false may be able to remove the title bar or perhaps getting the compositor object and changing it from there. However this will still keep the address and tab bars in chrome. You may need to find another method to signal chrome to hide those.
There is not really an easy way to do this, the thread you linked is in regards to VLC and modifying it's source code.

How to Launch multiple browsers in TOSCA?

I am new to TOSCA, kindly guide me How to Launching multiple browsers in TOSCA?
Thanks in advance.
Sreeni
Additionally to what Kapil said above (which was about using browsers), here is how you can actually "launch" (=start) browsers.
Tosca treats browsers like any other application - you can start a browser using the TBox Start Program module (that you can get access to by importing the standard subset).
Tosca's manual actually provides an example of how to start Internet Explorer using that module, it works in a similar fashion with the other browsers. Here is a screenshot:
For the sake of completeness, here's the link to the manual for more details: https://support.tricentis.com/community/manuals_detail.do?lang=en&version=10.0.0&url=ep_tbox/process_operations/process_operations.htm
We cannot trigger multiple browsers in TOSCA, but it supports cross browser execution. For cross browser execution:
1. Create a Test Configuration Parameter "Browser" either at TestCase or at its parent levels.
2. We can choose value InternetExplorer, Firefox, or Chrome.
3. The execution will be triggered on respective browser.
In order to achieve parallel execution we have to go with Distributed Execution (DEX).

Photoswipe working on browser but not on devices

I'm a beginner and I'm trying to use photoswiper in a PhoneGap app. I'm trying to use this example :
[http://jsfiddle.net/Gajotres/PFqVs/][1]
that works great in any browser, but just don't work on any device.
When I open, it's like I have a css issue since I don't see any king of style and when I touch any image, I just see it full size but can't swipe to see the next one.
Any help will be appreciated!
May be you should mention all sites with external resources in the WhiteList?

How to create a sidebar(right-side) in google chrome?

It seems that it is not possible, but if anyone as a hint on how to create a right-sided sidebar (like a iframe) in google chrome, any hint will help. Thanks.
The experimental sidebar API has, as of this time, disappeared from the chrome documentation, since there is no longer a developer working on it.
Your best bet for something that you can achieve now is a DOM bar, as discussed in Creating a StumbleUpon-like toolbar for Chrome
If you mean something like that
This is from the google chrome experimental api:
Caution: Don't depend on these
experimental APIs. They might
disappear, and they will change. Also,
the Chrome Developer Dashboard doesn't
allow you to upload extensions that
use experimental APIs.
Details: http://www.chromium.org/chromium-os/user-experience/panels

Resources