Skip to main content
added 416 characters in body
Source Link
Tamara Wijsman
  • 57.7k
  • 24
  • 45

Found the relevant code:

var c=this.jDiv.find(".comment-form");

c.find(".discussion-info").length ||
  ($("<div style='margin:12px 0 3px; font-weight:bold' class='discussion-info'>Please avoid extended  discussions in comments. Would you like to <a href='#'>automatically move this discussion to chat?</a></div>")
  .find("a").click(function(a){
    $(this).unbind("click");
    a.preventDefault();
    b.ajax({url:"/posts/"+b.postId+"/move-discussion-to-chat", data:{fkey:StackExchange.options.user.fkey},type:"POST"},"when trying to move the discussion to chat",c).done(function(a){a.success?window.location.href=a.message:StackExchange.helpers.showErrorPopup(c,a.message)})}).end().prependTo(c),a.remove())}}});

So, we can see that it is doing a POST to /posts/{postId}/move-discussion-to-chat and StackExchange.options.user.fkey is passed along; this would require an user script to replicate. Simply because you can only make GET requests through your address bar...

Here are observations when reproducing this:

  1. It does not work on Meta.SU, simply because there is no chat for Meta.SU.

  2. This does not work on posts you are not involved in, luckily...

  3. Refiring this on my posts does not seem to work, the conditions are effectively checked.

     HTTP/1.1 404 Not Found
     Cache-Control: private
     Content-Type: application/json
     Set-Cookie: usr=t=$$$$&s=$$$$; domain=.superuser.com; expires=$$$$; path=/; HttpOnly
     Date: $$$$
     Content-Length: 0
    

    Note that I filtered away personal information with $$$$.

    Alternatively, it could use cookies to check whether the requests have not been tampered with. Seems the Stack Exchange developers do their job well, for a good reason...

Found the relevant code:

var c=this.jDiv.find(".comment-form");

c.find(".discussion-info").length ||
  ($("<div style='margin:12px 0 3px; font-weight:bold' class='discussion-info'>Please avoid extended  discussions in comments. Would you like to <a href='#'>automatically move this discussion to chat?</a></div>")
  .find("a").click(function(a){
    $(this).unbind("click");
    a.preventDefault();
    b.ajax({url:"/posts/"+b.postId+"/move-discussion-to-chat", data:{fkey:StackExchange.options.user.fkey},type:"POST"},"when trying to move the discussion to chat",c).done(function(a){a.success?window.location.href=a.message:StackExchange.helpers.showErrorPopup(c,a.message)})}).end().prependTo(c),a.remove())}}});

So, we can see that it is doing a POST to /posts/{postId}/move-discussion-to-chat and StackExchange.options.user.fkey is passed along; this would require an user script to replicate. Simply because you can only make GET requests through your address bar...

Here are observations when reproducing this:

  1. It does not work on Meta.SU, simply because there is no chat for Meta.SU.

  2. This does not work on posts you are not involved in, luckily...

Found the relevant code:

var c=this.jDiv.find(".comment-form");

c.find(".discussion-info").length ||
  ($("<div style='margin:12px 0 3px; font-weight:bold' class='discussion-info'>Please avoid extended  discussions in comments. Would you like to <a href='#'>automatically move this discussion to chat?</a></div>")
  .find("a").click(function(a){
    $(this).unbind("click");
    a.preventDefault();
    b.ajax({url:"/posts/"+b.postId+"/move-discussion-to-chat", data:{fkey:StackExchange.options.user.fkey},type:"POST"},"when trying to move the discussion to chat",c).done(function(a){a.success?window.location.href=a.message:StackExchange.helpers.showErrorPopup(c,a.message)})}).end().prependTo(c),a.remove())}}});

So, we can see that it is doing a POST to /posts/{postId}/move-discussion-to-chat and StackExchange.options.user.fkey is passed along; this would require an user script to replicate. Simply because you can only make GET requests through your address bar...

Here are observations when reproducing this:

  1. It does not work on Meta.SU, simply because there is no chat for Meta.SU.

  2. This does not work on posts you are not involved in, luckily...

  3. Refiring this on my posts does not seem to work, the conditions are effectively checked.

     HTTP/1.1 404 Not Found
     Cache-Control: private
     Content-Type: application/json
     Set-Cookie: usr=t=$$$$&s=$$$$; domain=.superuser.com; expires=$$$$; path=/; HttpOnly
     Date: $$$$
     Content-Length: 0
    

    Note that I filtered away personal information with $$$$.

    Alternatively, it could use cookies to check whether the requests have not been tampered with. Seems the Stack Exchange developers do their job well, for a good reason...

added 128 characters in body
Source Link
Tamara Wijsman
  • 57.7k
  • 24
  • 45

Found the relevant code:

var c=this.jDiv.find(".comment-form");

c.find(".discussion-info").length ||
  ($("<div style='margin:12px 0 3px; font-weight:bold' class='discussion-info'>Please avoid extended  discussions in comments. Would you like to <a href='#'>automatically move this discussion to chat?</a></div>")
  .find("a").click(function(a){
    $(this).unbind("click");
    a.preventDefault();
    b.ajax({url:"/posts/"+b.postId+"/move-discussion-to-chat", data:{fkey:StackExchange.options.user.fkey},type:"POST"},"when trying to move the discussion to chat",c).done(function(a){a.success?window.location.href=a.message:StackExchange.helpers.showErrorPopup(c,a.message)})}).end().prependTo(c),a.remove())}}});

So, we can see that it is doing a POST to /posts/{postId}/move-discussion-to-chat and StackExchange.options.user.fkey is passed along; this would require an user script to replicate. Simply because you can only make GET requests through your address bar...

Here are observations when reproducing this:

  1. It does not work on Meta.SU, simply because there is no chat for Meta.SU.

  2. This does not work on posts you are not involved in, luckily...

Found the relevant code:

var c=this.jDiv.find(".comment-form");

c.find(".discussion-info").length ||
  ($("<div style='margin:12px 0 3px; font-weight:bold' class='discussion-info'>Please avoid extended  discussions in comments. Would you like to <a href='#'>automatically move this discussion to chat?</a></div>")
  .find("a").click(function(a){
    $(this).unbind("click");
    a.preventDefault();
    b.ajax({url:"/posts/"+b.postId+"/move-discussion-to-chat", data:{fkey:StackExchange.options.user.fkey},type:"POST"},"when trying to move the discussion to chat",c).done(function(a){a.success?window.location.href=a.message:StackExchange.helpers.showErrorPopup(c,a.message)})}).end().prependTo(c),a.remove())}}});

So, we can see that it is doing a POST to /posts/{postId}/move-discussion-to-chat and StackExchange.options.user.fkey is passed along; this would require an user script to replicate. Simply because you can only make GET requests through your address bar...

Found the relevant code:

var c=this.jDiv.find(".comment-form");

c.find(".discussion-info").length ||
  ($("<div style='margin:12px 0 3px; font-weight:bold' class='discussion-info'>Please avoid extended  discussions in comments. Would you like to <a href='#'>automatically move this discussion to chat?</a></div>")
  .find("a").click(function(a){
    $(this).unbind("click");
    a.preventDefault();
    b.ajax({url:"/posts/"+b.postId+"/move-discussion-to-chat", data:{fkey:StackExchange.options.user.fkey},type:"POST"},"when trying to move the discussion to chat",c).done(function(a){a.success?window.location.href=a.message:StackExchange.helpers.showErrorPopup(c,a.message)})}).end().prependTo(c),a.remove())}}});

So, we can see that it is doing a POST to /posts/{postId}/move-discussion-to-chat and StackExchange.options.user.fkey is passed along; this would require an user script to replicate. Simply because you can only make GET requests through your address bar...

Here are observations when reproducing this:

  1. It does not work on Meta.SU, simply because there is no chat for Meta.SU.

  2. This does not work on posts you are not involved in, luckily...

added 719 characters in body
Source Link
Tamara Wijsman
  • 57.7k
  • 24
  • 45

The only way would be to check outFound the link with a Web Inspector, then see how it is made.relevant code:

var c=this.jDiv.find(".comment-form");

c.find(".discussion-info").length ||
  ($("<div style='margin:12px 0 3px; font-weight:bold' class='discussion-info'>Please avoid extended  discussions in comments. Would you like to <a href='#'>automatically move this discussion to chat?</a></div>")
  .find("a").click(function(a){
    $(this).unbind("click");
    a.preventDefault();
    b.ajax({url:"/posts/"+b.postId+"/move-discussion-to-chat", data:{fkey:StackExchange.options.user.fkey},type:"POST"},"when trying to move the discussion to chat",c).done(function(a){a.success?window.location.href=a.message:StackExchange.helpers.showErrorPopup(c,a.message)})}).end().prependTo(c),a.remove())}}});

ThenSo, we can see that it might be possible to sendis doing a requestPOST to that link before you reach the limit/posts/{postId}/move-discussion-to-chat and see whatStackExchange.options.user.fkey is passed along; this would happenrequire an user script to replicate. IfSimply because you want we can try this out when we're both around, or perhaps anyone else is up for it?only make GET requests through your address bar...

The only way would be to check out the link with a Web Inspector, then see how it is made.

Then, it might be possible to send a request to that link before you reach the limit and see what would happen. If you want we can try this out when we're both around, or perhaps anyone else is up for it?

Found the relevant code:

var c=this.jDiv.find(".comment-form");

c.find(".discussion-info").length ||
  ($("<div style='margin:12px 0 3px; font-weight:bold' class='discussion-info'>Please avoid extended  discussions in comments. Would you like to <a href='#'>automatically move this discussion to chat?</a></div>")
  .find("a").click(function(a){
    $(this).unbind("click");
    a.preventDefault();
    b.ajax({url:"/posts/"+b.postId+"/move-discussion-to-chat", data:{fkey:StackExchange.options.user.fkey},type:"POST"},"when trying to move the discussion to chat",c).done(function(a){a.success?window.location.href=a.message:StackExchange.helpers.showErrorPopup(c,a.message)})}).end().prependTo(c),a.remove())}}});

So, we can see that it is doing a POST to /posts/{postId}/move-discussion-to-chat and StackExchange.options.user.fkey is passed along; this would require an user script to replicate. Simply because you can only make GET requests through your address bar...

Source Link
Tamara Wijsman
  • 57.7k
  • 24
  • 45
Loading