• We've moved. Our community is now at ownd.sh — latest discussions and updates live there.

[Userscript] Hide bump posts in marketplace threads [TamperMonkey]

Ping

~[pings.exchange]~
Royal
Ping Rep
0
0
0
Rep
1007
Ping Vouches
11
0
0
Vouches
11
Posts
3,312
Likes
1,245
3 YEARS
3 YEARS OF SERVICE
I made a small Tampermonkey userscript to make sales threads easier to read when they have pages of bump posts.

It looks for posts containing “This is a bump” and hides them from your view.

Each hidden post leaves a small placeholder with a “Show this post” button, so you can still check it if you want.

There’s also a floating toggle to show or hide all bumps on the current page, and it remembers your choice.

This is a browser-side quality-of-life tool. It doesn’t change the thread, remove anyone’s posts, or affect a seller’s ability to bump.

How to use it:

- Install Tampermonkey.

- Add the attached script.Code:

Code:
// ==UserScript==

// @name         ownd.sh — Hide Bump Posts

// @namespace    https://ownd.sh/

// @version      1.2.0

// @description  Hide posts whose message is only "This is a bump", ignoring signatures and post controls.

// @match        https://ownd.sh/Thread-*

// @match        https://www.ownd.sh/Thread-*

// @match        https://ownd.sh/showthread.php*

// @match        https://www.ownd.sh/showthread.php*

// @grant        none

// @run-at       document-idle

// ==/UserScript==

(() => {

  'use strict';

  const PHRASE = 'This is a bump';

  const STORAGE_KEY = 'cracked-hide-bumps-enabled';

  const BODY_SELECTOR = '.post_body, .postbody, .post_message, .post-content, .message, [id^="post_message_"]';

  const EXTRAS = '.signature, .post_signature, .post-signature, .edited, .post_edit, .post-edit, .post_meta, .post-meta, .post_controls, .post-controls, .post_buttons, .post-buttons, .reactions, .reaction, .likes, .likebar, .thanks, .award, .awards, .postbit_buttons, script, style';

  const processed = new WeakMap();

  let enabled = localStorage.getItem(STORAGE_KEY) !== 'false';

  let toolbar, button, countLabel, scheduled = false;

  const css = document.createElement('style');

  css.textContent = `

    .cb-toolbar { position: fixed; right: 16px; bottom: 16px; z-index: 2147483647;

      display: flex; align-items: center; gap: 8px; padding: 9px 12px;

      background: #20242b; color: #fff; border: 1px solid #78818d;

      border-radius: 8px; box-shadow: 0 3px 14px #0007; font: 13px/1.3 system-ui, sans-serif; }

    .cb-toolbar button, .cb-placeholder button { cursor: pointer; padding: 5px 9px;

      background: #3468b6; color: #fff; border: 0; border-radius: 5px; font: inherit; }

    .cb-toolbar button:focus-visible, .cb-placeholder button:focus-visible { outline: 2px solid #ffcc62; }

    .cb-hidden { display: none !important; }

    .cb-placeholder { margin: 8px 0; padding: 7px 10px; border: 1px dashed #8994a0;

      border-radius: 5px; background: #252a30; color: #fff; font: 13px/1.4 system-ui, sans-serif; }

    .cb-placeholder button { margin-left: 8px; }

  `;

  document.head.append(css);

  function messageOnly(body) {

    const copy = body.cloneNode(true);

    copy.querySelectorAll(EXTRAS).forEach(node => node.remove());

    const text = (copy.textContent || '').replace(/[\s\u200b-\u200d\ufeff]+/g, ' ').trim();

    if (text !== PHRASE) return false;

    return !copy.querySelector('img, video, audio, iframe, object, embed, svg, canvas, input, textarea, a[href]');

  }

  function findPosts() {

    const found = [];

    document.querySelectorAll('[id^="post_"]').forEach(post => {

      if (!/^post_\d+$/.test(post.id)) return;

      const bodies = [...post.querySelectorAll(BODY_SELECTOR)].filter(node => node.closest('[id^="post_"]') === post);

      // Use the deepest matching message container: outer wrappers may contain signatures and controls.

      const body = bodies.find(node => !bodies.some(other => other !== node && node.contains(other)));

      if (body && messageOnly(body)) found.push(post);

    });

    return found;

  }

  function makeToolbar() {

    toolbar = document.createElement('div');

    toolbar.className = 'cb-toolbar';

    countLabel = document.createElement('span');

    button = document.createElement('button');

    button.type = 'button';

    button.addEventListener('click', () => {

      enabled = !enabled;

      localStorage.setItem(STORAGE_KEY, String(enabled));

      update();

    });

    toolbar.append(countLabel, button);

    document.body.append(toolbar);

  }

  function addPlaceholder(post) {

    const placeholder = document.createElement('div');

    placeholder.className = 'cb-placeholder';

    placeholder.append(document.createTextNode('Bump post hidden.'));

    const reveal = document.createElement('button');

    reveal.type = 'button';

    reveal.textContent = 'Show this post';

    const state = { placeholder, revealed: false };

    reveal.addEventListener('click', () => {

      state.revealed = !state.revealed;

      post.classList.toggle('cb-hidden', enabled && !state.revealed);

      reveal.textContent = state.revealed ? 'Hide this post' : 'Show this post';

    });

    placeholder.append(reveal);

    post.before(placeholder);

    processed.set(post, state);

  }

  function update() {

    const posts = findPosts();

    document.querySelectorAll('.cb-placeholder').forEach(placeholder => {

      const post = placeholder._cbPost;

      if (!post?.isConnected || !posts.includes(post)) {

        post?.classList.remove('cb-hidden');

        placeholder.remove();

      }

    });

    posts.forEach(post => {

      if (!processed.get(post)?.placeholder.isConnected) {

        addPlaceholder(post);

        processed.get(post).placeholder._cbPost = post;

      }

      const state = processed.get(post);

      post.classList.toggle('cb-hidden', enabled && !state.revealed);

      state.placeholder.hidden = !enabled;

    });

    if (!toolbar && posts.length) makeToolbar();

    if (toolbar) {

      toolbar.hidden = posts.length === 0;

      const label = enabled ? 'Show all bumps' : 'Hide bumps';

      if (button.textContent !== label) button.textContent = label;

      button.setAttribute('aria-pressed', String(enabled));

      const count = `${posts.length} bump${posts.length === 1 ? '' : 's'} on this page`;

      if (countLabel.textContent !== count) countLabel.textContent = count;

    }

  }

  update();

  new MutationObserver(() => {

    if (scheduled) return;

    scheduled = true;

    requestAnimationFrame(() => { scheduled = false; update(); });

  }).observe(document.body, { childList: true, subtree: true });

})();

- Reload a thread and use the toggle in the bottom-right corner.

If you find a bug or have a suggestion, let me know!
PepeMusic2.gif




[expires  08/11/2026]

[Selling Signature Ad Space - DM Me]

[Ping's PGP Key]

Before conducting any form of business confirm my identity through onsite PM.
 

Attachments

  • PepeMusic2.gif
    PepeMusic2.gif
    14.7 KB · Views: 0

Eminem

Divine
Divine
Rep
0
0
0
Rep
1800
Vouches
11
0
0
Vouches
11
Posts
4,616
Likes
4,847
Bits
3 YEARS
3 YEARS OF SERVICE
ty



06/12/2026



11/12/2026



10/12/2026
 

Ping

~[pings.exchange]~
Royal
Ping Rep
0
0
0
Rep
1007
Ping Vouches
11
0
0
Vouches
11
Posts
3,312
Likes
1,245
3 YEARS
3 YEARS OF SERVICE
Updated script to fix a bug.



[expires  08/11/2026]

[Selling Signature Ad Space - DM Me]

[Ping's PGP Key]

Before conducting any form of business confirm my identity through onsite PM.
 

ZalandoGC

Divine
Divine
ZalandoGC Rep
0
0
Rep
2345
ZalandoGC Vouches
128
0
0
Vouches
128
Posts
3,103
Likes
7,082
Bits
7 YEARS
7 YEARS OF SERVICE
This is a bump



ZALANDO GIFTCARDS | 45% OFF with 45WEEKEND

| Instant Delivery | Crypto Accepted

TG: @Syncat69 | Discord: Syncat69
 
ZalandoGC's signature

Ping

~[pings.exchange]~
Royal
Ping Rep
0
0
0
Rep
1007
Ping Vouches
11
0
0
Vouches
11
Posts
3,312
Likes
1,245
3 YEARS
3 YEARS OF SERVICE
This is a bump but also a test for v3 of the script (Goal not to hide posts that contain more than just the string "This is a bump")



[expires  08/11/2026]

[Selling Signature Ad Space - DM Me]

[Ping's PGP Key]

Before conducting any form of business confirm my identity through onsite PM.
 

179,162

126,023

1,405,739

Top