ENH add a 'tab.contentType' property to the tab object

RESOLVED FIXED

Status

Add-on SDK
General
P3
normal
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: canuckistani, Assigned: zer0)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

As suggested by Ciavash:

https://groups.google.com/d/msg/mozilla-labs-jetpack/U2jHWqgXu48/ZnXkZJ7-9CEJ

As I see it, this is so that developers could programatically react to the content type of a tab.
(Assignee)

Updated

5 years ago
Assignee: nobody → zer0

Comment 1

5 years ago
It can be useful when you want to do something based on type of the content. If you want to add something to the image viewer for example, you need to know that the content is an image, then do something with it.

In my add-on, I had to look for "resource://gre/res/TopLevelImageDocument.css" in the link tag to find out that an image is being displayed.
My add-on: https://addons.mozilla.org/en-US/firefox/addon/imgviewerplus/
(Assignee)

Comment 2

5 years ago
Created attachment 643967 [details]
Pointer to Github pull request: https://github.com/mozilla/addon-sdk/pull/502

Pointer to Github pull-request
(Assignee)

Updated

5 years ago
Attachment #643967 - Flags: review?(rFobic)
This will work correctly on mobile, yes?
Priority: -- → P3
(Assignee)

Comment 4

5 years ago
`tabs` module doesn't work on mobile at all, so I'm not sure I got the question. Mobile should supports the `document.contentType`, so as soon as the `tabs` module will works on Mobile, that properties will be work as well (along `url` and `title` properties).

if I misunderstood the question, could you be more explicit?
Attachment #643967 - Flags: review?(rFobic) → review+

Comment 5

5 years ago
Commits pushed to master at https://github.com/mozilla/addon-sdk

https://github.com/mozilla/addon-sdk/commit/22ef0f33ffb300692391c632d59f68bc71693602
Bug 775606 - ENH add a 'tab.contentType' property to the tab object

Added `tab.contentType` to tabs API, updated test and docs

https://github.com/mozilla/addon-sdk/commit/1002551cb9932869292d645c6a90e93204cd7090
Merge remote-tracking branch 'upstream/master' into tab.contentType/Bug775606

Conflicts:
	packages/api-utils/lib/tabs/tab.js

https://github.com/mozilla/addon-sdk/commit/74f25256b5aa57a187d87d990f5fec5d1d45d0fd
Merge pull request #502 from ZER0/tab.contentType/Bug775606

fix Bug 775606 - ENH add a 'tab.contentType' property to the tab object r=@gozala
(Assignee)

Updated

5 years ago
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED

Updated

5 years ago
You need to log in before you can comment on or make changes to this bug.