ClericPy / ichrome

Chrome controller for Humans, based on Chrome Devtools Protocol(CDP) and python3.7+.
https://pypi.org/project/ichrome/
MIT License
235 stars 29 forks source link

Use of "new_tab" and Chromium in Kiosh mode ... #22

Closed stopoverandcatchfire closed 4 years ago

stopoverandcatchfire commented 4 years ago

If I use Chromium in Kiosh mode after use "tab = chrome.new_tab()" the Kiosh mode is lost and browser returns with the conventional layout.

You can try your "examples_sync.py" and add "--kiosh" as "extra_config: ["--kiosh"].

After "tab = chrome.new_tab()" the "kiosh" is lost.

Any solution ?

ClericPy commented 4 years ago

--app and --kiosk mode is often used for single page app (SPA), not very good at multi-tabs usage.

And back to the question, is your 'kiosh' mode a typo? (kiosk?)

stopoverandcatchfire commented 4 years ago

I'm sorry I typed wrong, "--kiosh" ---> "--kiosk".

I was looking for a python wrapper for "chrome-devtools". I tried "Chromote", "selenium" and "ichrome", but with the last one when I open a "tabs", chromium exits from the "kiosk" mode.

I was wondering why and if there was a possibility that this thing didn't happen.

I wanted to keep two pages open and switch between two "tabs" instead of reloading the pages alternately.

ClericPy commented 4 years ago

I can not reproduct that issue with Chrome Daemon, didn't install Chromium

  1. Launch the chrome daemon
    python3 -m ichrome --kiosk

    This Chrome window is in kiosk mode.

  2. Connect to the chrome port
    
    from ichrome.debugger import Chrome
    import time

chrome = Chrome() tab0 = chrome[0] tab = chrome.new_tab('http://bing.com') time.sleep(1) tab0.activate_tab() time.sleep(1) tab0.activate_tab()


This chrome window is still in kiosk mode(full-screen), and activate tabs between tab0 and new tab.

So I can't reproduct this issue, maybe the reason is Chrome is different from chromium, or I run this script on windows.

PS: sync utils will hardly update new features, ichrome.debugger will translate most async utils into sync usage for debugging.
stopoverandcatchfire commented 4 years ago

Actually on Windows 10 there is no problem, it works perfectly.

I will do some other tests with Chromium-Browser, I will keep you informed.

Thank you very much and sorry for the wrong report.

ClericPy commented 4 years ago

Last Saturday I tried Chrome on linux(Manjaro) and no problem occured, maybe it's about chromium?

stopoverandcatchfire commented 4 years ago

The browser is "/usr/bin/chromium-browser" on "Raspberry Pi 3 Model B V1.2" with "Debian Buster".

After several tests I found the defect on "chromium-browser". If you use a switch "--incognito" on "extra_config", if you insert a new "tab" the "full screen" or "kiosk" mode is lost showing the frame and the all loaded tabs.

I'm sorry if I made you waste time. Your wrapper works perfectly.

ClericPy commented 4 years ago

The browser is "/usr/bin/chromium-browser" on "Raspberry Pi 3 Model B V1.2" with "Debian Buster".

After several tests I found the defect on "chromium-browser". If you use a switch "--incognito" on "extra_config", if you insert a new "tab" the "full screen" or "kiosk" mode is lost showing the frame and the all loaded tabs.

I'm sorry if I made you waste time. Your wrapper works perfectly.

No need to say sorry, happy to help you for me.

--incognito is not very smart choice if not very care that scene. May you be happy