-
Notifications
You must be signed in to change notification settings - Fork 203
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
Fixes #2409. Don't pre-fill forms for "self reports" (webcompat.com) #2439
Conversation
webcompat/static/js/lib/bugform.js
Outdated
// weird Gecko bug. See https://bugzilla.mozilla.org/show_bug.cgi?id=1098037 | ||
urlParam = this.trimWyciwyg(urlParam[1]); | ||
this.urlField.val(decodeURIComponent(urlParam)); | ||
var url = location.href.match(/url=([^&]*)/); |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
webcompat/static/js/lib/bugform.js
Outdated
@@ -18,6 +18,7 @@ function BugForm() { | |||
this.submitTypeInput = $("#submit_type:hidden"); | |||
this.uploadLabel = $(".js-label-upload"); | |||
this.uploadLoader = $(".js-image-loader"); | |||
this.urlParamRegExp = /url=([^&]*)/; |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
webcompat/static/js/lib/bugform.js
Outdated
@@ -182,18 +193,28 @@ function BugForm() { | |||
img.src = dataURI; | |||
}; | |||
|
|||
// Is the user trying to report a site against webcompat.com itself? | |||
this.isSelfReport = function() { |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
webcompat/static/js/lib/bugform.js
Outdated
this.isSelfReport = function() { | ||
var url = location.href.match(this.urlParamRegExp); | ||
if (url !== null) { | ||
if (_.includes(decodeURIComponent(url[0]), location.origin)) { |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
Thanks for review @Regaddi, hoping I can make changes today or tomorrow. |
lol |
Need help? 🙂 @miketaylr |
@Regaddi yeah... would you mind taking over the PR? Been swamped with other projects. >_< |
LGTM now. @miketaylr |
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.
Thanks so much @Regaddi
(just confirmed working locally as expected) |
r? @Regaddi