Remove Twitter Frames

Remove Twitter iFrames

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name        Remove Twitter Frames
// @namespace   radio)))
// @description Remove Twitter iFrames
// @match       *://*.resetera.com/threads/*
// @version     1
// @grant       none
// ==/UserScript==


(() => {

    'use strict'

    const frames = Array.from(document.querySelectorAll('iframe[src*="twitter"]'))

    // https://twitter.com/user/status/${id}
    frames.forEach(f => {
        const id = f.src.split('#')[1]
        f.insertAdjacentHTML('beforebegin', `<a target=_blank href="https://twitter.com/user/status/${id}">Tweet</a>`)
        f.parentElement.removeChild(f)
    })

 })();