Skip to content

Conversation

@kyoshino
Copy link
Contributor

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.

@xabolcs
Copy link
Collaborator

xabolcs commented Aug 17, 2017

From #235

I won't implement screenshot tools in favour of Firefox Screenshots.

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).
It would be even more cool if Firefox Screenshot will have an API for triggering screenshots or opening its entry point.

@kyoshino
Copy link
Contributor Author

There's the Firefox Screenshots button on the toolbar by default, so I think an extra menu item may not be necessary.

@xabolcs
Copy link
Collaborator

xabolcs commented Aug 17, 2017

OK.

@kyoshino
Copy link
Contributor Author

@whimboo Can you or someone get this reviewed and published on AMO?

Copy link
Contributor

@whimboo whimboo left a 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)
Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Contributor

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.
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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!

Copy link
Contributor Author

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
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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.

Copy link
Collaborator

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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; }
Copy link
Contributor

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/

Copy link
Contributor Author

@kyoshino kyoshino Sep 1, 2017

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.

Copy link
Contributor

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');
Copy link
Contributor

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.

Copy link
Contributor Author

@kyoshino kyoshino Sep 5, 2017

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)

* @param {String} command - A distinguishable command name.
*/
const handle_command = async command => {
if (command === 'copy_build_info') {
Copy link
Contributor

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.

Copy link
Contributor Author

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 😺

Copy link
Contributor

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
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@@ -0,0 +1,113 @@
{
Copy link
Contributor

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.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree with @whimboo, let @MikkCZ contribute in PR #242.

Copy link
Contributor Author

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.

@whimboo
Copy link
Contributor

whimboo commented Aug 30, 2017

@kyoshino would you have the time to address the remaining review comments?

@kyoshino
Copy link
Contributor Author

Sorry! Will work on it today.

@kyoshino
Copy link
Contributor Author

kyoshino commented Sep 1, 2017

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 added a commit to kyoshino/nightlyttr that referenced this pull request Sep 1, 2017
@whimboo
Copy link
Contributor

whimboo commented Sep 5, 2017

@kyoshino mind checking my latest replies? If all is fine I will do a second pass review.

kyoshino added a commit to kyoshino/nightlyttr that referenced this pull request Sep 5, 2017
@kyoshino
Copy link
Contributor Author

kyoshino commented Sep 5, 2017

Updated History.md and manifest.json as mentioned. Interdiff: kyoshino/nightlyttr@ea6b297

@whimboo
Copy link
Contributor

whimboo commented Sep 12, 2017

@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.

@kyoshino
Copy link
Contributor Author

kyoshino commented Sep 12, 2017

Agree to push this to the beta/dev channel first. Changed the version to 4.0pre-build1 and also changed the release date to TBD. My account is kyoshino (kohei.yoshino@gmail.com)

@whimboo
Copy link
Contributor

whimboo commented Sep 12, 2017

It's done now. So please feel to upload to AMO. Thanks.

@kyoshino
Copy link
Contributor Author

Uploaded! Looks like the version format has been tightened so I used 4.0pre20170912 instead like previous beta versions.

"homepage_url": "https://wiki.mozilla.org/QA/Automation/Projects/Addons/NightlyTesterTools",
"default_locale": "en_US",
"permissions": [
"<all_urls>",
Copy link
Contributor

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.

Copy link
Contributor Author

@kyoshino kyoshino Sep 12, 2017

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"default_locale": "en_US",
"permissions": [
"<all_urls>",
"activeTab",
Copy link
Contributor

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.

const is_textbox = 'placeholder' in $active && !$active.readOnly;

if (message.command === 'insert_to_textbox' && is_textbox) {
$active.value = message.value;
Copy link
Contributor

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. 👎

Copy link
Contributor Author

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.

Copy link
Contributor

@MikkCZ MikkCZ left a 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?

@kyoshino
Copy link
Contributor Author

It should work for any regular testboxes, both <textarea> and <input>.

@kyoshino
Copy link
Contributor Author

kyoshino commented Sep 12, 2017

Fixed the permissions and text inserting function as @MikkCZ suggested. Interdiff: kyoshino/nightlyttr@4e00238

Still, undo (Ctrl-Z) in textareas doesn't work. The Paste event might be the solution, but it's not supported in the content script yet. I also tried document.execCommand('insertText', false, str) with no luck.

@whimboo
Copy link
Contributor

whimboo commented Sep 13, 2017

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 4.0 milestone?

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.

@whimboo
Copy link
Contributor

whimboo commented Sep 13, 2017

Still, undo (Ctrl-Z) in textareas doesn't work. The Paste event might be the solution, but it's not supported in the content script yet. I also tried document.execCommand('insertText', false, str) with no luck.

@kyoshino please also file a new issue for that. Thanks.

@whimboo
Copy link
Contributor

whimboo commented Sep 13, 2017

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!

@whimboo whimboo merged commit d220575 into mozilla:master Sep 13, 2017
@kyoshino kyoshino deleted the 235-webextension branch September 13, 2017 11:52
This was referenced Sep 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants