qutebrowser / qutebrowser

A keyboard-driven, vim-like browser based on Python and Qt.
https://www.qutebrowser.org/
GNU General Public License v3.0
9.45k stars 1.01k forks source link

Query state of webpage in userscript? #8231

Closed OmegaLambda1998 closed 2 weeks ago

OmegaLambda1998 commented 2 weeks ago

Is it possible to query the state of the current webpage throughout the running of a userscript? I.e, If I send a command via FIFO, can I ask qutebrowser what mode, url, etc... it's changed to?

Can you say "do this, then wait for this, then do this"

OmegaLambda1998 commented 2 weeks ago

As an example of where this would be useful.

I use overleaf for writing my PhD thesis to aid in collaboration with my supervisors. I prefer to view pdfs in a local pdf viewer, so want to write a userscript which causes overleaf to recompile (via fake-key overleaf shortcuts), waits for the compilation to finish (currently just cmd-later, but this would be where querying would be helpful) then downloads the pdf

OmegaLambda1998 commented 2 weeks ago

Something similar to https://github.com/richardpenman/browsercookie would be awesome

The-Compiler commented 2 weeks ago

See #30 and #902.

As for reading cookies, #5500 might allow us to store them in a more readable format, but in theory you could already use projects that extract chromium cookies (there are a couple). I'm not sure if/when QtWebEngine/Chromium writes cookies to disk, though.