[feat] Initial check-in.

This commit is contained in:
Elf M. Sternberg 2016-02-06 16:40:44 -08:00
parent 2250cc5e6b
commit e18d72fc35
3 changed files with 64 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
#*
*~

40
README.md Normal file
View File

@ -0,0 +1,40 @@
# Tumblr Evil Detector
## Description
This is a simple TamperMonkey script that does one thing: warn you if
you're about to reblog a post with a script in it. Malicious users will
often hide javascript tags in the caption of a photograph which detects
when you're actually looking at the page (through mouse or keyboard
actions) and redirects you a site full of malware, spam, or porn. This
script is intended to help prevent that, and make your follower's
reading experience more pleasant.
## Installation
You will need Tampermonkey installed in your browser, then install the
Javascript file found in this directory into Tampermonkey.
## Behavior
The URL filter currently only identifies pages on Tumblr that are POST
pages. If the user has a custom DNS, sadly we can't detect them, but
few if any spammers go to those lengths to snare people. It will put a
message in the UPPER LEFT corner of the page with the words "SCRIPT
DETECTED" if a malicious javascript file is detected in the post
message.
That's all it does. It's very short. But it's also very effective.
## LICENSE:
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
## AUTHOR:
Me, Elf M. Sternberg <elf.sternberg@gmail.com>

21
tumblr-evil-detector.js Normal file
View File

@ -0,0 +1,21 @@
// ==UserScript==
// @name TumblrEvilDetector
// @namespace http://elfsternberg.com
// @version 0.1
// @description Detect if a Tumblr post has an embedded script in it
// @author Elf M. Sternberg <elf.sternberg@gmail.com>
// @match http://*.tumblr.com/post/*
// @grant none
// ==/UserScript==
/* jshint -W097 */
'use strict';
function tumblr_reblog_warning() {
var post = document.querySelectorAll('.post-wrapper script');
if (post.length > 0) {
document.body.innerHTML += ('<div style="background-color: rgba(0,0,0,0.6); float: right; position: absolute; top: 20px; width: 400px; color:limegreen; border: 4px solid limegreen">' +
'SCRIPT DETECTED</div>');
}
}
window.setTimeout(tumblr_reblog_warning, 500);