Closed Bug 1427463 Opened 6 years ago Closed 6 years ago

Implement tabs.captureTab(tabId)

Categories

(WebExtensions :: General, enhancement, P5)

enhancement

Tracking

(firefox59 fixed)

RESOLVED FIXED
mozilla59
Tracking Status
firefox59 --- fixed

People

(Reporter: ntim, Assigned: ntim)

References

(Depends on 1 open bug)

Details

(Keywords: dev-doc-complete, Whiteboard: [design-decision-approved])

Attachments

(1 file)

It seems absolutely arbitrary that we can only do tabs.captureVisibleTab() especially when we can already call ctx.drawWindow in a content script for background tabs, that allows doing the same thing, just in a much less convenient and more limited way (AMO/about pages unsupported for content scripts).

So I would like a tabs.captureTab(tabId) that provides the convenience of captureVisibleTab for all tabs without running into the limitations of content scripts.

I need this because I'm creating a new mode for VivaldiFox that allows matching the header color with the two first pixels of the page. You might think tabs.captureVisibleTab() does that perfectly fine, but unfortunately I need to wait for the page to load before I can capture a shot, which means it could capture the wrong tab if the user has switched tabs in between.
Assignee: nobody → ntim.bugs
Status: NEW → ASSIGNED
Severity: normal → enhancement
Priority: -- → P5
Whiteboard: [design-decision-needed]
Hi Tim, this has been added to the agenda for the January 9, 2018 WebExtensions APIs triage. Would you be able to join us? 

Here’s a quick overview of what to expect at the triage: 

* We normally spend 5 minutes per bug
* The more information in the bug, the better
* The goal of the triage is to give a general thumbs up or thumbs down on a proposal; we won't be going deep into implementation details

Relevant Links: 

* Wiki for the meeting: https://wiki.mozilla.org/WebExtensions/Triage#Next_Meeting
* Meeting agenda: https://docs.google.com/document/d/15JYw3L1490dKbr6yTLz1uirH8rfhcSiLJCubSWDlnfs/edit#
* Vision doc for WebExtensions: https://wiki.mozilla.org/WebExtensions/Vision
Whiteboard: [design-decision-needed] → [design-decision-approved]
Comment on attachment 8941424 [details]
Bug 1427463 - Implement tabs.captureTab(tabId).

https://reviewboard.mozilla.org/r/211726/#review219022
Attachment #8941424 - Flags: review?(mixedpuppy) → review+
Pushed by ntim.bugs@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/514a4f908be4
Implement tabs.captureTab(tabId). r=mixedpuppy
https://hg.mozilla.org/mozilla-central/rev/514a4f908be4
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
Is manual testing required on this bug? If Yes, please provide some STR and the proper webextension(if required), if No set the “qe-verify-“ flag.
Flags: needinfo?(ntim.bugs)
Flags: needinfo?(ntim.bugs) → qe-verify-
Added a page on this: https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/tabs/captureTab

Let me know if this covers it!

The compat data is also in review: https://github.com/mdn/browser-compat-data/pull/945
Flags: needinfo?(ntim.bugs)
(In reply to Will Bamberg [:wbamberg] from comment #7)
> Added a page on this:
> https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/tabs/captureTab
> 
> Let me know if this covers it!
> 
> The compat data is also in review:
> https://github.com/mdn/browser-compat-data/pull/945

looks good, thanks
Flags: needinfo?(ntim.bugs)
Great feature! Thanks a lot!

One issue though, I'm pretty sure `chrome.tabs.captureTab` with callback function is still capturing active tab only.
Function `browser.tabs.captureTab` works perfect.
(In reply to juraj.masiar from comment #9)
> Great feature! Thanks a lot!
> 
> One issue though, I'm pretty sure `chrome.tabs.captureTab` with callback
> function is still capturing active tab only.
> Function `browser.tabs.captureTab` works perfect.

It's not meant to be used with a callback function.
Product: Toolkit → WebExtensions

Just to verify - this API is not on Android on purpose, right?

In such case, please merge this PR if you can to update the docs:
https://github.com/mdn/browser-compat-data/pull/3714

Depends on: 1678480
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: