-
Notifications
You must be signed in to change notification settings - Fork 27
Fix #235 Rewrite NTT as webextension #245
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
Conversation
|
From #235
I would happy to see a link in the toolbar item menu pointing to that new Firefox Screenshots feature (at least for a few releases). |
|
There's the Firefox Screenshots button on the toolbar by default, so I think an extra menu item may not be necessary. |
|
OK. |
|
@whimboo Can you or someone get this reviewed and published on AMO? |
whimboo
left a comment
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.
First, this is awesome work @kyoshino! Thanks a lot, really! Only with your help we are able to keep the extension alive. And the basics look pretty good and are working as expected. Even the l18n support and all the locales is fantastic.
Nevertheless I have added a couple of review comments. Please go through them and let me know if you have questions. If we have to solve something you can also find me in the #automation channel on IRC. Thanks!
History.md
Outdated
| @@ -1,3 +1,7 @@ | |||
| 4.0 / 2017-08-16 | |||
| ================== | |||
| * Rewrite as WebExtension (#235) | |||
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 think we should add a bit more context here, so it explains that this is necessary for Firefox 57.0 onwards.
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 could say:
Rewrite as a WebExtension for Firefox 57+ since the legacy XUL format is no longer supported
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.
We call webextension only for the API, so a wording like "Rewrite extension to use the WebExtension API since the legacy format is no longer supported" makes more sense.
| # Nightly Tester Tools | ||
| Nightly Tester Tools is an addon for aiding testers of nightly builds of Mozilla apps like Firefox and Thunderbird. Some features are: | ||
|
|
||
| Nightly Tester Tools (NTT) is an add-on for aiding testers of Nightly builds of Mozilla apps including Firefox. |
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.
What is the status for Thunderbird and SeaMonkey? Would the current code also work in those applications?
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.
Thunderbird doesn't support WebExtensions yet. SeaMonkey does, but I've got an error like this. Given Firefox is our priority, will figure out how to support SeaMonkey later.
There was an error during installation: Add-on {8620c15f-30dc-4dba-a131-7c5d20cf4a29} is not compatible with application version. add-on minVersion: 56.0.
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.
Ok, please file a new issue so that we don't forget about it. Thanks!
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.
Filed #246.
README.md
Outdated
|
|
||
| * Copy Build ID to Clipboard | ||
| * Copy List of Extensions to Clipboard | ||
| * Insert Build ID into Textbox |
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.
Combine it with the other item for Build ID or just move it up.
README.md
Outdated
| * Copy Build ID to Clipboard | ||
| * Copy List of Extensions to Clipboard | ||
| * Insert Build ID into Textbox | ||
| * Insert List of Extensions into Textbox |
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.
Same here.
README.md
Outdated
|
|
||
| The following features found in the original XUL-based extension are not yet implemented: | ||
|
|
||
| * Copy about:support to Pastebin |
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.
It is even busted with the old extension for a long time now. I don't think we should mention it here and re-implement. If there is a need for, we can do it once it comes up.
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 strongly disagree.
IMHO it should be mentioned. It's our fault that we didn't changed the faulty backend.
Sure, it shouldn't be reimplemented for now. And the #93 should be reevaluated.
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.
Whatever, this part doesn't block a final review. So lets leave it in.
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'll keep it for reference.
| table { border-collapse: collapse; table-layout: fixed; } | ||
| caption { margin-bottom: 8px; } | ||
| tbody tr:hover { background-color: #EBEBEB; } | ||
| th, td { border: 1px solid #C1C1C1; padding: 4px 8px; } |
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.
Looks fantastic, even there are some quirks left. But those can be fixed later. But have a look. Some might be quick to do. Here what I noticed:
- If a variable is already part of the title, we might want to remove it when clicking it again. Right now it can be added multiple times.
- Using Ctrl/Cmd+Z to undo changes is not working
- s/XUL/Gecko/
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.
- Implemented the toggle (insert/remove) behaviour.
- Hmm yes, undo doesn't work for programmatically added values. I think it may be tricky to make it happen, because each textbox will require an event listener.
- Replaced XUL with Gecko.
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.
Great! So lets leave undo/redo out for now.
| .filter(ext => ext.type === 'extension') | ||
| .sort((a, b) => a.name > b.name) | ||
| .map(ext => ext.name + ' ' + ext.version + (ext.enabled ? '' : ' [DISABLED]')) | ||
| .join('\n'); |
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.
Please note #232. Maybe add a TODO item here.
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.
TODO added in the function comment. (see the interdiff)
extension/shared.js
Outdated
| * @param {String} command - A distinguishable command name. | ||
| */ | ||
| const handle_command = async command => { | ||
| if (command === 'copy_build_info') { |
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.
Lets make it a switch statement.
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 I like neither a series of if nor case. There's a better approach like this 😺
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 is fine as long as the underlying code to execute is not long enough. Lets keep what we have right now.
README.md
Outdated
| * Title bar customization | ||
| * Screenshots utility (Use Firefox Screenshots) | ||
| * Crash options | ||
| * Extension compatibility fixing |
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.
Please add the toolbar menu. Maybe we can reference the bugs which block us in all the above cases?
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 think not all of them have a relevant bug, so I'll keep the list. Once we have an issue for each on this repository, it can be referred here.
extension/_locales/cs/messages.json
Outdated
| @@ -0,0 +1,113 @@ | |||
| { | |||
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.
Lets not add locales which weren't part of the old extension. Those would need a signoff first. We can perfectly do this as a follow-up issue and PR.
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 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.
The cs locale has been added by @MikkCZ in kyoshino/nightlyttr#1 but agree to remove it for now so he can be credited properly via #242.
|
@kyoshino would you have the time to address the remaining review comments? |
|
Sorry! Will work on it today. |
|
Apologies for the delay, but I think all the concerns are now solved. It's ready for 🚢 Here's the interdiff: kyoshino/nightlyttr@a1f4293 If you're okay, add me as a NTT developer on AMO so I myself can submit the new version and update the description as well as the screenshot. |
|
@kyoshino mind checking my latest replies? If all is fine I will do a second pass review. |
|
Updated |
|
@kyoshino thank you for the update and the bit of delay. Would you mind to change the version to 4.0pre-build1 and then push a beta build to AMO? I would like to have people testing the extension before we are releasing it. If you send me your AMO account name, I can add you for sure. |
|
Agree to push this to the beta/dev channel first. Changed the version to |
|
It's done now. So please feel to upload to AMO. Thanks. |
|
Uploaded! Looks like the version format has been tightened so I used |
extension/manifest.json
Outdated
| "homepage_url": "https://wiki.mozilla.org/QA/Automation/Projects/Addons/NightlyTesterTools", | ||
| "default_locale": "en_US", | ||
| "permissions": [ | ||
| "<all_urls>", |
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 wonder why is this permission needed. I do not see any requests here, and the content script has the permission on its own.
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.
Ah, I guess it's no longer required since I've removed the (function to enable/disable) data pasting menus from the toolbar button. Will double check.
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.
extension/manifest.json
Outdated
| "default_locale": "en_US", | ||
| "permissions": [ | ||
| "<all_urls>", | ||
| "activeTab", |
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.
The activeTab permission can be probably avoided too. If it's because of the title manipulation, you can always change it from the content script, which is being loaded everywhere.
extension/content.js
Outdated
| const is_textbox = 'placeholder' in $active && !$active.readOnly; | ||
|
|
||
| if (message.command === 'insert_to_textbox' && is_textbox) { | ||
| $active.value = message.value; |
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 does not work as expected. You should at least append the text, instead of replacing it (or if possible insert where the cursor is). Imagine a situation when you write a very long bug report and adding the information at the end, because you forgot do it first. This replaces everything you have written, and for some reason Ctrl+Z does not work to undo it for me. 👎
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.
Agree, it should just append the string to the textbox.
MikkCZ
left a comment
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.
Please check the permissions (I know it's for nightly population), they seem to open to me. Inserting into textarea should really insert and not replace. Btw. is there any reason why you cannot insert into regular text input?
|
It should work for any regular testboxes, both |
|
Fixed the permissions and text inserting function as @MikkCZ suggested. Interdiff: kyoshino/nightlyttr@4e00238 Still, undo (Ctrl-Z) in textareas doesn't work. The |
|
I would suggest that we create a new issue for pasting the content. It makes it easier to review without having to go through this whole pile of code changes again. @MikkCZ mind filing an issue which blocks the Also in preparation of the merge to master I created the legacy branch so we keep the code of the old XUL based extension, and could do minor releases if really needed. |
@kyoshino please also file a new issue for that. Thanks. |
|
Ok, I'm going to merge this huge patch into master now. Then we can fix the remaining issues, and finally do the 4.0 release. @kyoshino, again thank you a lot for spending your time on this extension so we can keep it alive! |
This PR merges my WebExtension port into this official repository so it can soon be published on AMO. The current version just demonstrates what can be done with the standard WebExtensions API. As explained in #235 (comment), I'll explore how to implement other features using WebExtensions Experiments.