pageActions are never shown on about:blank and about:newtab URLs

NEW
Unassigned

Status

()

Toolkit
WebExtensions: Frontend
P5
normal
2 months ago
8 days ago

People

(Reporter: ValentinaP, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [pageAction]triaged)

Attachments

(1 attachment)

(Reporter)

Description

2 months ago
Created attachment 8845314 [details]
aboutblank.gif

Prerequisites:
- FF55 clean profile
- “xpinstall.signatures.dev-root” set to “true”
- “Back to Source Tab” WebExtension installed (test submission at - https://addons-dev.allizom.org/en-US/firefox/addon/back-to-the-source-tab-test/)

Steps to reproduce:
1. Open the developer tools Web Console (e.g. using the Developer Tools menu or Ctrl+Shif+K command)
2. Open a new blank tab using the console (command: window.open();)

Expected results:
Source tab option should be available in the about:blank tab.

Actual results:
Source tab option is not available in the about:blank tab.

Notes/Issues:
- reproducing also for new window (command:  window.open('','new-window-1','width=1920,height=1000'); )
Verified on FF55.0a1 (2017-03-08) using Windows 7.
Attaching video for this issue.

Comment 1

2 months ago
I did some testing and it seems that, while the onCreatedNavigationTarget event has been received as expected, the pageAction icons are not visible on some of the "about:" urls, e.g.

about urls where the pageAction is never shown:
- about:blank
- about:newtab

about urls where the pageAction is shown as for any other url:
- about:addons
- about:debugging
- about:config
- about:mozilla
- about:support
- about:robots

Comment 2

2 months ago
After some digging, I can confirm the behavior described by Comment 1.

It seems that we already meet this behavior in Bug 1316020 Comment 17.

The reason seems to be that URLBarSetURI (http://searchfox.org/mozilla-central/rev/78ac0ceba97bd2deed847a8d0ae86ccf7a8887bf/browser/base/content/browser.js#2534-2565) is marking "about:blank" and "about:newtab" as "invalid", while "about:addons" etc. are marked as "valid".

Also, in our test suite the `clickPageAction` test helper seems to workaround this kind of issue my forcing it to be marked as "valid": http://searchfox.org/mozilla-central/rev/78ac0ceba97bd2deed847a8d0ae86ccf7a8887bf/browser/components/extensions/test/browser/head.js#324-332
No longer blocks: 1190687
Component: WebExtensions: Request Handling → WebExtensions: Frontend
Summary: "about:blank" page does not have a "Back to source tab" option → pageActions are never shown on about:blank and about:newtab URLs
Whiteboard: [pageAction]

Comment 3

2 months ago
In particular, the following CSS rules are the one that hide (well, "collapse" to be precise) all the urlbar-icons (included the WebExtension PageActions, on the contrary the usercontext icon and label is in a different xul element and it is not hidden on urls considered "invalid"): 

http://searchfox.org/mozilla-central/rev/78ac0ceba97bd2deed847a8d0ae86ccf7a8887bf/browser/base/content/browser.css#579-584

If we want to make the WebExtensions pageActions visible on these URLs without introducing any additional risks/impact for any urlbar icon that is not related to the WebExtensions pageAction API, a reasonable option can be to introduce an additional and more specific CSS rule for the WebExtensions pageActions in the browser.css file, and exclude them from being collapsed on such URLs, something like:

    /* Ensure WebExtensions pageAction are not collapsed on about:blank and about:newtab URLs */
    #urlbar[pageproxystate="invalid"] > #urlbar-icons > .urlbar-icon.webextension-page-action {
      visibility: visible;
    }

How that sound to you Kris?
Flags: needinfo?(kmaglione+bmo)

Comment 4

2 months ago
Looking for front-end input on if the icon should be seen at this point.  know it's an area changing in photon
Flags: needinfo?(shorlander)

Updated

a month ago
Flags: needinfo?(kmaglione+bmo)

Updated

a month ago
Whiteboard: [pageAction] → [pageAction], Needs UX

Comment 5

11 days ago
shorlander

are we going to have the ability to show pageaction on about:pages?
Flags: needinfo?(amckay)
I don't think this has anything to do with Photon and I'm removing the ni for shorlander. Things might be changing in Photon but that's a seperate issue.

Given that this is low priority, I would recommend waiting till after Photon has landed though and seeing what the CSS looks like then.
Flags: needinfo?(shorlander)
Flags: needinfo?(amckay)
Priority: -- → P5
Whiteboard: [pageAction], Needs UX → [pageAction]triaged
You need to log in before you can comment on or make changes to this bug.