Add extension refresh triggers to scaffolding/website

RESOLVED FIXED in BW-M4

Status

addons.mozilla.org Graveyard
Collector Extension
P1
normal
RESOLVED FIXED
9 years ago
2 years ago

People

(Reporter: fligtar, Assigned: wenzel)

Tracking

unspecified
BW-M4

Details

Attachments

(1 attachment)

(Reporter)

Description

9 years ago
From bug 482735:

The extension adds a listener to every AMO page. If
the page triggers a "bandwagonRefresh" custom event, the extension will be
triggered to retrieve the list of the user's subscriptions from the server.

The website should trigger this custom event when:

1. a collection is subscribed.
2. a collection is unsubscribed.
3. the user logs in.

----------------------

The sample code needed is found here:
http://www.33eels.com/clients/briks/bandwagon/test-refresh-subscriptions.html
(Reporter)

Comment 2

9 years ago
We should add this to the current scaffolding for proper extension functionality.

Fred, can you take a look next week?
Assignee: nobody → fwenzel
(Assignee)

Comment 3

9 years ago
(In reply to comment #2)
> We should add this to the current scaffolding for proper extension
> functionality.

The cases 1 and 2 (comment 0) are obviously in the new bandwagon pages, but what about 3? Does that apply to any login even anywhere on AMO?

Comment 4

9 years ago
(In reply to comment #3)
> The cases 1 and 2 (comment 0) are obviously in the new bandwagon pages, but
> what about 3? Does that apply to any login even anywhere on AMO?

Probably not. Are there multiple login entry points? And if so, do they have any shared JavaScript that can send the event?
(Reporter)

Comment 5

9 years ago
Bandwagon will eventually have its own login page, but bug 478252 is stalled at the moment as we figure out whether we'll be setting a special bandwagon login cookie or what. So, I would say if we end up doing a special bandwagon login, it should only be on the bandwagon login page. If not, it should be on both.

Until the bandwagon login page is implemented, let's add it to the normal login page on bandwagon branch so that the extension can be used more easily, and we can move it to additional pages if necessary.
(Assignee)

Comment 6

9 years ago
(In reply to comment #4)
> Probably not. Are there multiple login entry points? And if so, do they have
> any shared JavaScript that can send the event?

Yes, you can log in on any page and will be redirected back to it. And while we have some JavaScript shared across the page, I will not be able to figure out that a user just logged in, *after* the redirect happens.

Seems to me like the closest we can get is firing the event when the login form is submitted, though at that time we neither have a login cookie yet, nor do we know if the credentials were right. Thoughts?
(Reporter)

Comment 7

9 years ago
Okay, let's skip adding to the login page for now. Once we have the Bandwagon login page made, we can add the JS there since we can control what happens after the user logs in exclusively for Bandwagon.
(Reporter)

Updated

9 years ago
Priority: -- → P1
(Assignee)

Comment 8

9 years ago
Created attachment 369391 [details] [diff] [review]
Refresh event for {un,}subscribe pages

Brian, will that work for you? I am creating a dummy element, then firing the event when the subscribe/unsubscribe page is "ready". If this is not what you expected, or if you need any data added to the dummy element's attributes, please let me know.
Attachment #369391 - Flags: review?(brian)
(Assignee)

Updated

9 years ago
Status: NEW → ASSIGNED

Comment 9

9 years ago
What does it mean for the subscribe/unsubscribe page to be "ready"?
(Reporter)

Comment 10

9 years ago
It's jQuery for when the page is ready for exciting things to happen.

http://docs.jquery.com/Events/ready
Comment on attachment 369391 [details] [diff] [review]
Refresh event for {un,}subscribe pages

Looks fine. I'm not sure it is needed before login though (if that is what subscribe.thtml is).
Attachment #369391 - Flags: review?(brian) → review+
The argument for it being needed after login is in the case when the user manages his subscriptions on more than one computer/profile.

In this case, the extension needs to be notified to update when the user returns to the profile on which the extension is installed, but did not necessarily witness the subscription add/remove events.
(Reporter)

Comment 13

9 years ago
I think this is fixed since we'll be logging in using the extension now instead of the website. Please correct me if I'm wrong.
Status: ASSIGNED → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED
(Reporter)

Comment 14

9 years ago
Actually, I'm not sure this was ever checked in. Getting reports that the refresh trigger isn't working, and wondering if we never added it to the site. Fred, did we check this in?
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
(Assignee)

Comment 15

9 years ago
Hm, doesn't look like I ever did, does it? :-/ I committed this to r25308. If we make subscribing to collections ajaxy at all, we obviously need to add this trigger there as well.
Status: REOPENED → RESOLVED
Last Resolved: 9 years ago9 years ago
Resolution: --- → FIXED
(Reporter)

Updated

8 years ago
Component: Collections → Collector Extension
QA Contact: collections → collector-extension
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.