Advertisement
jcunews

tiktok_disable_userpost_agewall.user.js

Jan 5th, 2023
1,803
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name        tiktok.com disable user-post agewall
  3. // @namespace   https://greasyfork.org/en/users/85671-jcunews
  4. // @version     1.0.1
  5. // @license     AGPL v3
  6. // @author      jcunews
  7. // @description Context: https://www.reddit.com/r/userscripts/comments/103bsf6/script_request_remove_sensitive_content_warning/
  8. // @match       https://www.tiktok.com/*
  9. // @grant       none
  10. // @run-at      document-start
  11. // ==/UserScript==
  12.  
  13. (() => {
  14.   var gei = HTMLDocument.prototype.getElementById;
  15.   HTMLDocument.prototype.getElementById = function(id) {
  16.     if (id === "SIGI_STATE") SIGI_STATE.text = SIGI_STATE.text.replace(/,"maskType":\d+/g, "");
  17.     return gei.apply(this, arguments)
  18.   };
  19.   var js = Response.prototype.json;
  20.   Response.prototype.json = function(s) {
  21.     var r = js.apply(this, arguments);
  22.     if (/tiktok\.com\/api\/post\/item_list/.test(this.url)) {
  23.       r.then(o => {
  24.         if (o?.itemList?.forEach) {
  25.           o.itemList.forEach(b => {
  26.             delete b.maskType
  27.           })
  28.         }
  29.       })
  30.     }
  31.     return r
  32.   };
  33. })()
  34.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement