Previously we'd do something horrible with string matching when we wanted to change an HTML element's class name with JavaScript.
var changeClass = function (el, add, remove) {
if (el) {
if (!el.className) {
el.className = '';
(function (w, d, a) { | |
var $ = w[a.k] = { | |
"a": a, "w": w, "d": d, | |
"s": {}, | |
"v": {}, | |
"f": (function () { | |
return { | |
// get a DOM property or text attribute | |
get: function (el, att) { | |
var v = null; |
// paste me into console to explore the counterintuitive problem found here: | |
// http://www.decisionsciencenews.com/2017/06/19/counterintuitive-problem-everyone-room-keeps-giving-dollars-random-others-youll-never-guess-happens-next/ | |
// setup: tweak as needed | |
var rounds = 10, turns = 1000, max = 100, start = 100; | |
// play one round | |
var round = function () { | |
// setup |
http://www.webtigerteam.com/websearch/websearch.js
I wonder if it would be demonstrably better if case-hardened?
Old School:
var clean = function (input) {
var testMe = input, dupeTest = '';
while (testMe !== dupeTest) {
testMe = new DOMParser().parseFromString(testMe, "text/html").documentElement.textContent;
dupeTest = testMe;
}
testMe = testMe.replace(/</g, '<');
return testMe;
const BLOCK_ME = "://www.facebook.com/tr/"; | |
chrome.webRequest.onBeforeRequest.addListener( | |
function(r) { | |
return { | |
cancel: r.url.indexOf(BLOCK_ME) != -1 | |
}; | |
}, | |
{urls: ["<all_urls>"]}, | |
["blocking"] |
// Fill blank image TITLE attributes with what's in their ALT attribute, if found. | |
((w, d) => { | |
let $ = { | |
// w = window | |
w: w, | |
// d = document | |
d: d, | |
f: { | |
// return an event's target element |
User accounts on Twitter are commonly identified by screen name, which may be changed by operators when they take over an account, or have been sitting on an old account for a long time and want to transition it into malicious use.
User IDs, however, are permanent. There are several services out there that will try to find them for you but it seems like a bad idea to me, since you're alerting them to the fact that there's something interesting about this account. There's also plenty of bad advice that uses many long-since-abandoned Twitter API endpoints.
As of this writing (2018-02-18) you can view source and search for /profile_banners/
, which will show something like this:
.enhanced-mini-profile .mini-profile .profile-summary {