Last active
February 5, 2023 05:46
-
-
Save twilight-sparkle-irl/4dcdc1f3bde007a0237378334665a675 to your computer and use it in GitHub Desktop.
unlock polls on tumblr (click the Raw button with Tampermonkey installed!)
This file contains hidden or 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== | |
// @name Poll Unlocker | |
// @version 0.1 | |
// @description gives u polls | |
// @author Twilight Sparkle | |
// @license MIT | |
// @match https://www.tumblr.com/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=tumblr.com | |
// @grant none | |
// @run-at document-start | |
// ==/UserScript== | |
// override tumblr intiial config | |
Object.defineProperty(window, '___INITIAL_STATE___', { | |
set(x) { | |
let state = x; // copy state | |
try { | |
let obf = JSON.parse(atob(state.obfuscatedFeatures)); // convert from base64, parse from string | |
obf.crowdsignalPollsNpf = true; // polls (new post format) | |
obf.crowdsignalPollsCreate = true; // poll creation | |
obf.allowAddingPollsToReblogs = true; // this one seems clear | |
state.obfuscatedFeatures = btoa(JSON.stringify(obf)); // compress back to string, convert to base64 | |
} catch (e) { | |
console.error("failed to mod obfuscatedFeatures!!! trying to fail gracefully", e) | |
} finally { | |
window['I_LOVE_JS'] = state; // save to proxy variable | |
} | |
}, | |
get() { | |
return window['I_LOVE_JS']; // return proxy variable | |
}, | |
enumerable: true, | |
configurable: true | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@nightpool i had some inkling that that might be the case but didn't think to check and then forgot. wagh. thank you!!