If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Browser API: Make it possible to display a statusbar when a link is hovered (href preview)

NEW
Unassigned

Status

()

Core
DOM
3 years ago
2 years ago

People

(Reporter: paul, Unassigned)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

3 years ago
In Firefox, hovering a link shows a floating status bar. We'd like to be able to reproduce this behavior with the Browser API.

This could be done using anonymousContent.

This could be an attribute on the iframe, or maybe a method.
(Reporter)

Updated

3 years ago
Blocks: 693515, 1115098
You mean the alt attribute or the title attribute right?
(Reporter)

Comment 2

3 years ago
(In reply to Kan-Ru Chen [:kanru] from comment #1)
> You mean the alt attribute or the title attribute right?

No. The href.
(Reporter)

Updated

3 years ago
Summary: Browser API: Make it possible to display a statusbar when a link is hovered → Browser API: Make it possible to display a statusbar when a link is hovered (href preview)
The info comes from http://mxr.mozilla.org/mozilla-central/source/dom/ipc/TabParent.cpp#1462
It's actually TabParent::RecvSetStatus().
Created attachment 8565486 [details] [diff] [review]
graphene.patch

Here a WIP. It covers just OOP.
Attachment #8565486 - Flags: feedback?(fabrice)
(Reporter)

Comment 6

3 years ago
Andrea, how would I use this from the Browser API? What will it look like?
Flags: needinfo?(amarchesini)
Paul, with this patch the parent app, controlling the mozbrowser iframe, you can do:

iframe.onstatuschanged = function(e) { ... e is a GrapheneStatusEvent:
iframe.onhidetooltip = function(e) { ... e is a GrapheneShowTooltipEvent
iframe.onshowtooltip = function(e) { ... e is a normal event.

a GrapheneStatusEvent is this:

interface GrapheneStatusEvent : Event
{
  readonly attribute GrapheneStatusType type; // "script" or "link"
  readonly attribute DOMString status;
};

and a GrapheneShowTooltipEvent is:

interface GrapheneShowTooltipEvent : Event
{
  readonly attribute unsigned long x;
  readonly attribute unsigned long y;
  readonly attribute DOMString tooltip;
};
Flags: needinfo?(amarchesini)
(In reply to Paul Rouget [:paul] from comment #2)
> (In reply to Kan-Ru Chen [:kanru] from comment #1)
> > You mean the alt attribute or the title attribute right?
> 
> No. The href.

The API in comment 7 looks fairly generic - does this also work, or could it work for element title attributes?
Comment on attachment 8565486 [details] [diff] [review]
graphene.patch

Review of attachment 8565486 [details] [diff] [review]:
-----------------------------------------------------------------

I think Fabrice is on vacation until the 25th. Forwarding to  Paul as my best guess as to who can provide feedback.
Attachment #8565486 - Flags: feedback?(fabrice) → feedback?(paul)
Comment on attachment 8565486 [details] [diff] [review]
graphene.patch

Review of attachment 8565486 [details] [diff] [review]:
-----------------------------------------------------------------

Trying to switch back to Fabrice since this wasn't looked into yet.
Attachment #8565486 - Flags: feedback?(paul) → feedback?(fabrice)
Comment on attachment 8565486 [details] [diff] [review]
graphene.patch

Review of attachment 8565486 [details] [diff] [review]:
-----------------------------------------------------------------

- That should not be graphene-specific. Let's expose that to any consumer of the mozbrowser api.
- We need something that also works in-process.
Attachment #8565486 - Flags: feedback?(fabrice) → feedback+
You need to log in before you can comment on or make changes to this bug.