-
Notifications
You must be signed in to change notification settings - Fork 203
Screenshot is not automatically added when using "Report site issue" #2509
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
Comments
@softvision-oana-arbuzov just to verify -- this is with the addon from AMO installed? And not the built-in menu item? |
@miketaylr I just tried to reproduce and indeed this is happening.
|
Thanks @karlcow. Sounds like a regression. |
Note:
|
@softvision-oana-arbuzov, are you able to get mozregression working on an android device? I'm running into some errors... ( It seems like maybe the bug is on the Firefox for Android side, it would be interesting to try to pin down what broke this. Something like |
@miketaylr , I was able to run mozrregression, but was not able to find a good Nightly build where the screenshot was automatically added when using "Report site issue" option. I've tried many different ranges:
It might be possible that it never worked on Nightly, but always worked on Release. |
Hm, it for sure has worked on Nightly. I'll try to debug further. Thanks. |
We will not work on it during Paris work week. |
@miketaylr @softvision-oana-arbuzov is it something related to the work of @wisniewskit or completely different? |
yep! he fixed it for us by porting the fennec reporter to a web extension. |
Reopening this issue, as per @miketaylr 's IRC note: Note: |
@softvision-sergiulogigan I assume you mean in Nightly? I see that it's working for me in DevEdition, so possible regression here. |
Interesting mozregression result here: 10:38.37 INFO: Last good revision: 02272a7500f3f3b643733d707caefd2f67dee1e8 Both related to deferring timers: |
Nothing really timer-related in the code that handles the message event, webcompat.com/webcompat/static/js/lib/bugform.js Lines 130 to 152 in 100d1e9
@wisniewskit, is there anything timer-ish in our web-extension that relates to sending screenshots? |
(Note: nothing about this bug before yesterday is relevant -- the symptoms are the same, but causes entirely unrelated. We can spin off a new bug if we need to). |
@miketaylr: hmm. It's working for me on today's nightly. Our code isn't explicitly using any timers, no. It uses a standard extension API to grab the screenshot, then it POSTS using an experimental addon API, then it uses another standard extension API to send the screenshot using a So unless these are somehow thrown off by those two bug-fixes, I'm not sure what's going on. Is any message logged to the browser console when the screenshot fails? |
I wonder if there's some subtle timing issue related to when webextensions run? Will investigate a bit more. |
Steps to reproduce with 67.0a1 (2019-02-21) (64-bit)
|
Loading the page of the site.
Then using the menu to report site issue (°°°)
|
Note to self: Panos mentioned he ran into this, and it seems like it sometimes worked, and sometimes didn't. |
Starting to look into this now. On Nightly, for my local server it seems to work 100% of the time for small /simple images. However, I can get the bug to reproduce consistently with this URL: |
Just testing out a theory here, and it seems to work: diff --git a/webcompat/static/js/lib/bugform.js b/webcompat/static/js/lib/bugform.js
index f8daca67..b555b247 100644
--- a/webcompat/static/js/lib/bugform.js
+++ b/webcompat/static/js/lib/bugform.js
@@ -84,7 +84,22 @@ function BugForm() {
this.stepsToReproduceField = this.inputs.steps_reproduce.el;
this.contactField = this.inputs.contact.el;
+ // Is the user trying to report a site against webcompat.com itself?
+ this.isSelfReport = function(href) {
+ href = href || location.href;
+ var url = href.match(this.urlParamRegExp);
+ if (url !== null) {
+ if (_.includes(decodeURIComponent(url[0]), location.origin)) {
+ return true;
+ }
+ }
+ return false;
+ };
+
this.init = function() {
+ // Set up listener for message events from screenshot-enabled add-ons
+ window.addEventListener("message", this.onReceiveMessage.bind(this), false);
+
this.checkURLValidity = this.checkURLValidity.bind(this);
this.checkDescriptionValidity = this.checkDescriptionValidity.bind(this);
this.checkProblemTypeValidity = this.checkProblemTypeValidity.bind(this);
@@ -93,7 +108,6 @@ function BugForm() {
this.checkOptionalNonEmpty = this.checkOptionalNonEmpty.bind(this);
this.storeClickedButton = this.storeClickedButton.bind(this);
this.onFormSubmit = this.onFormSubmit.bind(this);
- this.onReceiveMessage = this.onReceiveMessage.bind(this);
this.preventSubmitByEnter = this.preventSubmitByEnter.bind(this);
// Make sure we're not getting a report
@@ -125,9 +139,6 @@ function BugForm() {
// See if the user already has a valid form
// (after a page refresh, back button, etc.)
this.checkForm();
-
- // Set up listener for message events from screenshot-enabled add-ons
- window.addEventListener("message", this.onReceiveMessage, false);
};
this.onReceiveMessage = function(event) {
@@ -202,18 +213,6 @@ function BugForm() {
img.src = dataURI;
};
- // Is the user trying to report a site against webcompat.com itself?
- this.isSelfReport = function(href) {
- href = href || location.href;
- var url = href.match(this.urlParamRegExp);
- if (url !== null) {
- if (_.includes(decodeURIComponent(url[0]), location.origin)) {
- return true;
- }
- }
- return false;
- };
-
// Do some extra work based on the GET params that come with the request
this.checkParams = function() {
// Don't bother doing any work for bare requests. It seems like with the timing changes, perhaps we're getting the screenshot slightly faster than our script even knows what to do with it, depending on how big or small the image is (🤔). We could register a message event handler as early as possible and stash the data to be picked up once |
URL: http://www.google.com/ redirecting to www.webcompat.com
Browser / Version: Firefox Nightly 62.0a1 (2018-06-17)
Operating System: Samsung Galaxy S6 (Android 7.0) - Resolution 1440 x 2560 pixels (~577 ppi pixel density), Google Pixel (Android 8.1.0) - 1080 x 1920 pixels (~441 ppi pixel density)
Prerequisites:
1. “webcompat.com reporter” add-on installed on Firefox.
Steps to Reproduce:
1. Navigate to any site (e.g http://www.google.com/)
2. Tap “More” button.
3. Tap “Report site issue”.
4. Observe form.
Expected Behavior:
Screenshot is automatically added to “Screenshot” area.
Actual Behavior:
Screenshot is not available in the “Screenshot” area.
Note
1. Not reproducible on Desktop.
2. Not reproducible on Firefox Release 60.0.2
3. Affected area:
Watchers:
@softvision-sergiulogigan
@softvision-oana-arbuzov
sv;
The text was updated successfully, but these errors were encountered: