21

Screenshot / Code Snippet

"Detect OpenAI" link in post menu; notice with results

About

This script adds a link to each post, to check it against Hugging Face's AI detector.

Download

The script can be installed via this link; source code can be found here.

Platform

Tested with Violentmonkey in Firefox on macOS, but it's likely to work on all browsers and platforms. (Please let me know if it doesn't!)

Contact

Post a comment or answer here, or create an issue/pull request on GitHub.

0

4 Answers 4

3

Please add the button for new answers as well or posts that have been reloaded in general (because of an edit, for example).

1
  • 1
    Fixed in version 0.4 - well, at least for edits, and I'm quite sure it works for new answers as well. Please let me know if it doesn't, and thanks for the suggestion!
    – Glorfindel
    Jan 1 at 17:52
3

Based on this comment I replaced the alert message with a normal message. I created a PR (Pull Request) on GitHub.

New look:

Image: "According to Hugging Face, the chance that this post was generated by OpenAI is 80%."

Tested on:

Tampermonkey v4.18.1

Chrome Version 108.0.5359.125 (Official Build) (64-bit)

5
  • 5
    Thank you; I thought it would be better to use the standard Stacks notice instead, so I've made an update on my own.
    – Glorfindel
    Dec 25, 2022 at 11:34
  • 2
    @Glorfindel you can use StackExchange.helpers.showToast('message') for simplicity. Dec 25, 2022 at 11:58
  • 2
    @double-beep TIL ... did I miss / forget about some documentation?
    – Glorfindel
    Dec 25, 2022 at 12:41
  • Any documented link for all StackExchange.helpers.--- ??
    – 4b0
    Dec 25, 2022 at 12:50
  • 3
    @Glorfindel it's not documented anywhere. There are types for some SE functions. Dec 25, 2022 at 13:22
2

Looks like this commit broke the script on Tampermonkey on Chrome.
The current version (0.9) doesn't work.

When I click "Detect OpenAI" it throws an error

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'dispatchEvent')

and points to this line.

3
1

It seems that comments (and formatting blocks on a post?) containing a link to a post's revision also have a non-working "Detect OpenAI" link appended.

Example:

You can prepend a paragraph with >! (like this) to add a spoiler block, but it only works on questions and answers, not comments :)Detect OpenAI – Aki Tanaka♦ Jan 13 at 15:16

Screenshot

4
  • The link has to end in view-source then it gets picked up as a "revision link". It's supposed to only work in the revisions view.
    – VLAZ
    Jan 17 at 15:54
  • @VLAZ ah, I see. Yeah, I guess this is really an edge case since it's very rare for someone to link to the revision's source.
    – Andrew T.
    Jan 17 at 16:00
  • At least for me, using the most recent version of the userscript, the button appended to the end of the comment is functional. While this might be unintended, and the formatting could be better, I can see some situations where this could be quite useful.
    – Makyen
    Jan 17 at 17:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .