-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update 'Contributors' section automatically in about:nightly. Fixes #58. #85
Update 'Contributors' section automatically in about:nightly. Fixes #58. #85
Conversation
--HG-- rename : extension/chrome/content/aboutNightly.xhtml => extension/chrome/content/aboutNightly/aboutNightly.xhtml
…ing those from the install.rdf
* The Initial Developer of the Original Code is | ||
* Dave Townsend <dtownsend@oxymoronical.com>. | ||
* | ||
* Portions created by the Initial Developer are Copyright (C) 2007 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This credit goes to you. Also please update the year. I hope that we can have a patch for the MPL2 license soon. Would you be interested in doing that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whimboo commented on commit
I hope that we can have a patch for the MPL2 license soon. Would you be interested in doing that?
Sure!
I'd like to provide a file list with three element in the MPL2 issue (#39) before creating the commit:
- files with new boilerplate
- files with changed boilerplate
- files with no boilerplate
Of course all files would came from extension
directory.
- noting myself as initial developer, year - adding others from cvs and hg blame (the EM stuff, appendToList) - destructuring assignment to set Ci, Cu, ... - uppercasing ADDONID - no more has_EM - real callback of fillContributorsCallback - move extensionLoader() to ExtensionManager.getAddonByID() - ... and it now fills just names, no url for creator - new line at end of file - removing event listener - team changes in install.rdf
Otherwise I like that change. Looks good and we can land it soon. |
- ADDON_ID - haveAM
if (haveAM) { | ||
AddonManager.getAddonByID(ADDON_ID, fillContributorsCallback); | ||
} else { | ||
ExtensionManager.getAddonByID(ADDON_ID, fillContributorsCallback); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no need for an if/else condition. Please directly put the code in the above try/catch block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whimboo commented on commit
There is no need for an if/else condition. Please directly put the code in the above try/catch block.
I desagree about that.
haveAM
is almost as safe as have_EM
was.
But the recommended try ... catch
method is more unsafe. It could hide underlying problems. (At least more than haveAM
could.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this method you will not get any other information why the Cu.import() could have been failed. So the code I'm talking about here should be:
'+ try {
- Cu.import("resource://gre/modules/AddonManager.jsm");
- AddonManager.getAddonByID(ADDON_ID, fillContributorsCallback);
- } catch(e) {
- ExtensionManager.getAddonByID(ADDON_ID, fillContributorsCallback);
- }`
whimboo commented on commit
Yeah, because of that have I used Therefore I proposed the |
Ah i see. Sure we can fix that by using: var manager = null;
try:
var { AddonManager: manager } = Cu.import("resource://gre/modules/AddonManager.jsm");
catch (e) {
var manager = ExtensionManager;
}
if (manager) {
...
} else {
throw whatever we want to report.
} |
whimboo commented on commit
Thanks, this is more acceptable for me. :) |
|
||
var manager = null; | ||
try { | ||
var { AddonManager: manager } = Cu.import("resource://gre/modules/AddonManager.jsm"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would redeclare manager
which already exists since line 50. We should simply remove the var
here. I would assume that will work.
} else { | ||
throw Components.Exception("no usable Manager found", | ||
Cr.NS_ERROR_NOT_IMPLEMENTED); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually to be honest, when would we fail? It should never happen except syntax failures in the ExtensionManager
class we would see in either way. I don't see a reason for the else case here.
@whimboo:
|
var ExtensionManager = { | ||
getAddonByID: function (aID, aCallback) { | ||
if (!aID || typeof aID !== "string") | ||
throw Components.Exception("aID must be a non-empty string", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reading through the docs for Components.Exception it tells me that those should be used for XPCOM components. Here we do not have a XPCOM component implemented in JS so I think we should better throw an Error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I decided to use Components.Exception
based on Bug 757663 comment 3, to be consistent with AddonManager. For the details see Bug 759642!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Chatted with unfocused about it and as he mentioned we can even safely make use of Components.Exception in our js modules. So we are good here.
With the remaining items fixed we will have a good template for coding styles and we can get the code checked-in. Thanks in advance for the update. |
@xabolcs, would you mind to fix the remaining nits? I kinda would like to get this pushed soon. |
whimboo commented:
I try my best, but I'm currently busy so not sure if I could provide an update this week. |
No worries. Whenever you have time. Thanks! |
- if brackets - aCurrentItem
@whimboo, 5th set of commits added. |
Just tested and it looks great! I'm going to merge it now. |
Hi!
This pull request contains:
chrome://global/skin/about.css
)