Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added indicator_section to status bar (refs #334) #351

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

GSI
Copy link
Contributor

@GSI GSI commented Feb 14, 2017

Please note the possible relation as outlined in #334 (comment)

# As these indicators slow down uzbl, they're disabled by default
set view_mode_indicator \@- if ('\@page_view_mode' == 'web') '<span foreground="#eee8d5" background="#586e75">'; else '<span foreground="#586e75" background="#eee8d5">'; -\@VM</span>
# TODO find out why this fails
#set css_indicator \@- if (document.getElementsByTagName("link").length === 0) '<span foreground="#eee8d5">'; else '<span foreground="#eee8d5" background="#2aa198">'; -\@CS</span>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is likely failing because @- runs in a clean js environment which is not the same as where the DOM of the page lives

set plugins_indicator \@- if (\@enable_plugins == 0) '<span foreground="#eee8d5">'; else '<span foreground="#eee8d5" background="#b58900">'; -\@PL</span>
set ssl_policy_indicator \@- if ('\@ssl_policy' != 'fail') '<span foreground="#eee8d5">'; else '<span foreground="#eee8d5" background="#268bd2">';-\@VS</span>
#set indicator_section <span foreground="cyan">@view_mode_indicator@css_indicator@images_indicator@cookie_indicator@javascript_indicator@plugins_indicator@ssl_policy_indicator</span>
# NOTE the more of the indicators we include here (and thus actually display), the slower uzbl gets.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rewriting this to only use one js expansion would perhaps be faster

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But I guess it's a better test case of the other issue this way XD

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without @indicator_section I am unable to reproduce issue #298. (Which probably doesn't mean it's not there anymore, but that I am simply too slow at typing Esc followed by e :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I think I'm able to reproduce the bug now but lets take that over in that issue.

That problem aside it's likely not good to do this much work in the status format anyway because it's evaluated a lot. The approach taken by the scroll percentage is the way to go. i.e react to events and update simple variables that we later use in the format. ON_SET for most of them and then probably LOAD_FINISHED for the html/css one?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this work? @on_event ON_SET enable_scripts set javascript_indicator \@- if (\@enable_scripts == 0) '<span foreground="#eee8d5">'; else '<span foreground="#eee8d5" background="#d33682">'; -\@JS</span>

Just tried without success ...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I toggle CSS on & off without reloading by replacing rel="stylesheet" with rel="uzbl_surpressed_stylesheet" in the link element. So LOAD_FINISH would not apply (in my case). The rest sounds fair, though!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think something like that should work. I'll have to poke at it a bit myself though because I don't exactly remember the syntax.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants