balta2ar / brotab

Control your browser's tabs from the command line
MIT License
389 stars 27 forks source link

Get HTML instead of text? #31

Closed dufferzafar closed 4 years ago

dufferzafar commented 4 years ago

bt text $(bt active) is useful, but sometimes I'd actually prefer to just get the HTML and do the parsing myself.

Could you provide a command to get the HTML from the DOM?

balta2ar commented 4 years ago

Implemented in version 1.3.0. Note that both pip and browser extension update are required. Firefox version has been published already, but Chrome version is going to be available later after the review (from days to weeks).

balta2ar commented 4 years ago

Oh and for consistency with "bt text", newlines and tabs are removed by default before sending HTML back from the browser (so that HTML fits on a single line). I hope it's OK for your purposes. You can play with --delimiter-regex argument though, but I spent half an hour trying to make it return HTML as is and dropped that idea.

dufferzafar commented 4 years ago

Why is this required though? I mean why does it all have to fit on a single line?

balta2ar commented 4 years ago

That way you get a nice columnar output similar to bt text

dufferzafar commented 4 years ago

I'm getting this with with brotab 1.3.0 - both pip package and firefox extension are at 1.3.0

> bt html

Cannot access API b.    localhost:4626  874178  firefox: HTTP Error 404: NOT FOUND
balta2ar commented 4 years ago

Could you make sure you reloaded the plug-in or restarted the browser? It must be the old version of the mediator app running