-
-
Save CertainPerformance/a22ac42a81a7ae80b360910f9864be5b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Userscript: | |
const formData = new FormData(); | |
const { fkey } = window.StackExchange.options.user; | |
formData.append('fkey', fkey); | |
formData.append('taskTypeId', '3'); | |
// taskResultTypeId possibilities: | |
// 4: "Delete". 9: "Recommend Deletion". | |
// Difference between 4 and 9 looks to be cosmetic only. Even if 4 is chosen, no delete votes will be spent via the /task-reviewed/ POST. | |
// (Without any userscripts, the delete vote that counts and is registered is sent in a separate request) | |
formData.append('taskResultTypeId', '4'); | |
const initOptions = { | |
body: formData, | |
credentials: 'same-origin' as const, | |
method: 'POST', | |
}; | |
fetch(`https://stackoverflow.com/review/task-reviewed/${taskId}`, initOptions) | |
.then( // response and error handling, etc... | |
// In contrast, Stack Exchange's native request uses XHR rather than fetch to submit the review choice | |
// and in the form data, in addition to the 3 fields above, also has postCommentId taskResultSubtypeFlags, both of which can be the empty string | |
// Stack Exchange's native interface for 20k users also sends a delete vote in a *separate* request | |
// to https://stackoverflow.com/posts/${postId}/vote/10 | |
// with formData of { fkey } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment