[Done] Show "Block" button only when the object is

Various discussions related to Adblock Plus development
Locked
Wladimir Palant

[Done] Show "Block" button only when the object is

Post by Wladimir Palant »

I said quite a few times before that it is impossible to detect when Flash (or a different object) is hovered. Which is why the "Block" button is permanently visible. Luckily, I was now proven wrong: http://userstyles.org/styles/17142

Ideally, Adblock Plus would not insert anything into the document at all. Only when the object is hovered the "Block" button should be created and displayed. This would solve several problems:

1. Users are annoyed by seemingly pointless "Block" buttons. On the other hand, they often don't realize that this button is how you block Flash - if the button appears after the mouse is moved to the Flash object the connection will be more obvious.

2. Insertion of the object tab sometimes messes up the objects (common for Flash on Mac).

3. Object tab position gets wrong if object's dimensions/position change over time - if we only display the object tab when necessary we can recalculate the position every time.

Will have to try a few things to see whether the ideal solution is doable - or whether we still need to insert the object tab immediately but hide/unhide it as necessary.
Last edited by Wladimir Palant on Tue Jul 14, 2009 4:21 pm, edited 2 times in total.
peekaboo

how about a key sequence?

Post by peekaboo »

Why not hook the CTRL key? CTRL key down, block buttons show.

At the least, can there be a key sequence to toggle adblocking? CTRL A and its enabled would save a lot of mouse fishing.
Sweet.
reepicheep
Posts: 126
Joined: Wed Dec 24, 2008 1:15 pm

Re: how about a key sequence?

Post by reepicheep »

peekaboo wrote:Why not hook the CTRL key? CTRL key down, block buttons show.

At the least, can there be a key sequence to toggle adblocking? CTRL A and its enabled would save a lot of mouse fishing.
Except on non-Windows platforms CTRL has other meanings and to toggle buttons like that would be very distracting. Plus purloining specifc and standard CTRL-key sequences is not a good idea; CTRL-A is almost universally a shortcut for "Select All".
Wladimir Palant

Re: how about a key sequence?

Post by Wladimir Palant »

peekaboo wrote:At the least, can there be a key sequence to toggle adblocking? CTRL A and its enabled would save a lot of mouse fishing.
Sweet.
http://adblockplus.org/en/faq_customization#shortcuts

As to the other suggestion - how is anybody supposed to know that he has to press Ctrl to block Flash?
Wladimir Palant

Post by Wladimir Palant »

Made some progress on this: http://hg.mozdev.org/adblockplus/rev/35d11a947cc2

This already makes sure that the "Block" button only appears when the object is hovered. Position of the button is calculated when it shows up. Outstanding issues:

* Mouse over object isn't always recognized, especially when the mouse pointer moves fast or user switches windows. Also, moving from one object to another isn't recognized. This is a Firefox issue, not much I can do about it.
* When the button is repositioned it briefly appears at its original position before being moved - doesn't look nice.
* Still inserting an element into the document, this might cause issues (but the code is less problematic now).
* Bug 12910 is still alive but it might be possible to fix it now.
* Apparently, ":hover" only works for objects if you specify the tag name as well, no idea why that is. Let's hope that objects will stay limited to <object>, <embed> and <applet> tags.

Development build coming.

Edit: Development build is available - http://adblockplus.org/development-buil ... en-hovered. Please test and tell me what you think.
User avatar
fanboy
Posts: 3446
Joined: Sun Jun 17, 2007 4:45 am
Contact:

Post by fanboy »

How about making object tabs disabled by default?
Wladimir Palant

Post by Wladimir Palant »

fanboy wrote:How about making object tabs disabled by default?
Why? Nobody will ever find them then and we will be swamped in questions along the lines of "Adblock Plus cannot block this ad, why?" We have lots of these questions already.
Wladimir Palant

Post by Wladimir Palant »

Wladimir Palant wrote:* Apparently, ":hover" only works for objects if you specify the tag name as well, no idea why that is. Let's hope that objects will stay limited to <object>, <embed> and <applet> tags.
Bug 500075 lifted the mystery, this behavior is for quirks mode only (apparently some website cannot deal with ":hover" being supported on all elements). Fixed this issue (http://hg.mozdev.org/adblockplus/rev/32fac8c08096), now object tabs aren't limited to specific tags.
User avatar
fanboy
Posts: 3446
Joined: Sun Jun 17, 2007 4:45 am
Contact:

Post by fanboy »

Wasnt object tabs causing incorrect readings on acid3?
pete

Post by pete »

When you move you mouse over a flash object and then use your scroll mouse, the label stays fixed. It doesn't follow the scrolling page.
Example: http://www.youtube.com/watch?v=M9BON5nd8Fg
Move you mouse over the film and scroll (stay with your mouse within the object).

When you reenter the object, the label gets redrawn on the correct position.


Also it would be nice, if the label would be more unobtrusive. Nearly every time I hover over a object, i get distracted by the label. A slow fade effect and/or delay would be cool, but I don't know if this is possible.
Wladimir Palant

Post by Wladimir Palant »

fanboy wrote:Wasnt object tabs causing incorrect readings on acid3?
This was a while ago. No, it doesn't do that any more.
pete wrote:When you move you mouse over a flash object and then use your scroll mouse, the label stays fixed.
Yes, I fixed this already, new development build will be out soon.
Wladimir Palant wrote:* When the button is repositioned it briefly appears at its original position before being moved - doesn't look nice.
This is mostly taken care of in http://hg.mozdev.org/adblockplus/rev/eae534acf07a
Wladimir Palant wrote:* Still inserting an element into the document, this might cause issues (but the code is less problematic now).
* Bug 12910 is still alive but it might be possible to fix it now.
I tried a few things but without success, looks like these two won't be fixed. Still, current solution is significantly better than what we had before.

Edit: New development build: http://adblockplus.org/development-buil ... s-on-flash
pete

Post by pete »

With the new build, the tab position is incorrect. It seems to have an offset of circa 300px.

Image

Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; de; rv:1.9.1) Gecko/20090616 Firefox/3.5
Adblock Plus 1.1alpha.0+.2009062508
Wladimir Palant

Post by Wladimir Palant »

pete, thanks. I tested on YouTube before but not for this build. Will check what went wrong there.
Wladimir Palant

Post by Wladimir Palant »

Fixed position calculation: http://hg.mozdev.org/adblockplus/rev/4e462b509b84
Re-uploaded the development build, this issue should be gone in the current version.
Locked