nE0sIghT / gnome-browser-extension-mirror

GNOME Shell integration for Chrome
https://wiki.gnome.org/Projects/GnomeShellIntegrationForChrome
GNU General Public License v3.0
29 stars 21 forks source link

Installed extensions page shows updates available for system extensions #86

Open afontenot opened 6 years ago

afontenot commented 6 years ago

Following up on https://github.com/nE0sIghT/chrome-gnome-shell-mirror/issues/78, it looks like I am actually seeing an issue. The version of the code I'm using is supposed to not check for updates on system extensions, and it looks like that's working, i.e. the json returned to the browser doesn't contain the "version" key.

"places-menu@gnome-shell-extensions.gcampax.github.com": {
  "extension-id": "places-menu",
  "uuid": "places-menu@gnome-shell-extensions.gcampax.github.com",
  "settings-schema": "org.gnome.shell.extensions.places-menu",
  "gettext-domain": "gnome-shell-extensions",
  "name": "Places Status Indicator",
  "description": "Add a menu for quickly navigating places in the system.\nThis extension is part of Classic Mode and is officially supported by GNOME. Please do not report bugs using the form below, use GNOME Bugzilla instead.",
  "url": "http://git.gnome.org/gnome-shell-extensions",
  "type": 1,
  "state": 1,
  "path": "/usr/share/gnome-shell/extensions/places-menu@gnome-shell-extensions.gcampax.github.com",
  "error": "",
  "hasPrefs": false
}

I think I have tracked the problem down to the Gnome website, which uses the following script on the Installed Extensions page: https://extensions.gnome.org/static/js/extensions.44c10442d280.js

Specifically this bit of code here, starting on line 273:

if (_state !== ExtensionState.UNINSTALLED && latest !== null &&
    (!meta.version || latest.version > meta.version || _state === ExtensionState.OUT_OF_DATE))
{
    $elem.addClass('upgradable');
}

meta.version gets populated from the json sent to the browser, and so it's undefined for system extensions. That means that all system extensions get marked as upgradable. That's exactly the behavior I see, as shown in the screenshot below.

screenshot of problem

nE0sIghT commented 6 years ago

That was made "by design".

  1. If you have some system extensions - chrome-gnome-shell will not check updates for them.
  2. if you go at e.g.o. then you will see all your system extensions and available updates for them. And you are free to install or not to install updates.
  3. If you install update for system extension - it became local extension.
  4. chrome-gnome-shell will check updates for local extensions that replaced system extensions.
afontenot commented 6 years ago

Seems like a bug for it to be shown as "upgradable". Should be a "convert to local extension" button instead, or something. It's not at all obvious what will happen when one tries to upgrade a system extension at present.