Skip to content

Vote count viewer no longer works #14

@InSyncWithFoo

Description

@InSyncWithFoo

When clicking on the vote count of a post, this error is logged:

Uncaught TypeError: Cannot read properties of undefined (reading '0')
    at Object.success (bypass_min_rep_view_vote_counts_script.js:119:34)
    at i (jquery.min.js:2:27449)
    at Object.fireWith [as resolveWith] (jquery.min.js:2:28213)
    at y (jquery.min.js:4:22721)
    at b.onload.b.onreadystatechange (jquery.min.js:4:27968)

The traceback leads to this line:

json = json.items[0];

...in which json is:

{
	"error_id": 404,
	"error_message": "no method found with this name",
	"error_name": "no_method"
}

This is due to postId not being correctly retrieved:

$this.siblings('input[type="hidden"]').val();
// A long, random-ish upvote/downvote hash

The "Post timeline" button can be used instead:

$this.siblings('a[href^="/posts/"]').attr('href').split('/')[2];

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions