Addons Manager: Disable the "Find updates" button in Extensions during offline mode

ASSIGNED
Assigned to

Status

()

Toolkit
Add-ons Manager
ASSIGNED
10 years ago
3 years ago

People

(Reporter: tchung, Assigned: aryx)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

10 years ago
User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9b3) Gecko/2008020418 Firefox/3.0b3
Build Identifier: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9b3) Gecko/2008020418 Firefox/3.0b3

When in offline mode, the Find Updates button should be disabled and greyed out in Addons > Extensions pane.   The other tabs are this way, so this should reflect consistency

Reproducible: Always

Steps to Reproduce:
1. Install Fx3 beta 3
2. switch to work offline mode
3. open Addons manager > Extensions
4. Verify Find updates button should be disabled and grayed out.  

** Screenshot
Actual Results:  
Disabled Find Updates buton in offline mode

Expected Results:  
Find updates button is enabled.
(Reporter)

Comment 1

10 years ago
Created attachment 301578 [details]
Disable Find Updates button screenshot
It is disabled on the plugins pane because you cannot search for updates for the plugins. It shouldn't be disabled on the themes page, unless the only theme is the default one, which we don't search for updates for.

For extensions I suspect the reasoning was that it would be confusing to have a disabled button with no idea of why it is disabled, clicking it should display a notification about why it doesn't work. Then again the state of it is all getting pretty confusing.
(Reporter)

Comment 3

10 years ago
Clicking the button on extensions, during offline mode, drops down a "No Updates found."  but yeah, its already confusing at this point.  
and if in offline mode the notification provides the option to go online which I think is the best behavior when in offline mode. We might try to educate users as to why it is disabled but this hasn't been an issue of any significance.

Updated

10 years ago
Depends on: 417583
Product: Firefox → Toolkit
Dave, with the rewrite nothing has been changed. We now even have the update check enabled for all types of add-ons. It issue has only been moved from the button into the AOM tools dropdown.
Created attachment 670736 [details] [diff] [review]
Patch: Disable network dependent UI in Add-ons Manager if application is offline, v1
Assignee: nobody → archaeopteryx
Status: NEW → ASSIGNED
Attachment #670736 - Flags: review?(bmcbride)
Comment on attachment 670736 [details] [diff] [review]
Patch: Disable network dependent UI in Add-ons Manager if application is offline, v1

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

Looks good, could really do with a browser-chrome test though. Doesn't need to be much - just check the notification is visible when running cmd_findAllUpdates/cmd_findItemUpdates in offline mode. And modify browser_dragdrop.js.

::: toolkit/locales/en-US/chrome/mozapps/extensions/extensions.dtd
@@ +64,5 @@
>  <!ENTITY updates.updating.label               "Updating add-ons">
>  <!ENTITY updates.installed.label              "Your add-ons have been updated.">
>  <!ENTITY updates.downloaded.label             "Your add-on updates have been downloaded.">
>  <!ENTITY updates.restart.label                "Restart now to complete installation">
> +<!ENTITY updates.offline.label                "You are currently offline. To check for add-on updates, you have to be online.">

Think we should re-use the terminology the add-on update dialog uses for this, which is to say the "<app> is working offline"/"<app> needs to go online", rather than the user/their computer is offline.


So something like:
"&brandShortName; needs to go online to be able to check for add-on updates."

::: toolkit/mozapps/extensions/content/extensions.js
@@ +79,5 @@
>    document.removeEventListener("load", initialize, true);
> +  window.addEventListener("offline", gViewController.onOfflineChange, false);
> +  window.addEventListener("online", gViewController.onOfflineChange, false);
> +  if (Services.io.offline) {
> +    gViewController.onOfflineChange;

Nit: No need for { } brackets when the contents are a single line.

@@ +647,5 @@
>      event.initEvent("ViewChanged", true, true);
>      this.currentViewObj.node.dispatchEvent(event);
>    },
> +  
> +  onOfflineChange: function gVC_onOfflineChange() {

Nit: Added trailing whitespace in the line above.

@@ +3292,5 @@
>  
>      // Convert every dropped item into a url
>      for (var i = 0; i < dataTransfer.mozItemCount; i++) {
>        var url = dataTransfer.mozGetDataAt("text/uri-list", i);
> +      if (url && !Services.io.offline) {

Hmm, yea, I guess this makes sense. Pity there's no nice way to provide any feedback here :\
Attachment #670736 - Flags: review?(bmcbride) → review-
You need to log in before you can comment on or make changes to this bug.