Skip to content
TORNLIFE More

[Script] Chat Link Embeds

Started by dingus [3188789] on in Tools & Userscripts.

10 replies · 268 views · thread synced · 4 days ago · View on torn.com
About this thread

Posts archived: 11 / 11 posts (100%) · the total is Torn's reply count + the opening post at the last fetch

Counted by TornLife from the archived posts.

Archived posts
11
Discussion span
→
People posting
8
Likes on archived posts
12
Authority score
37 / 100
Historical score
33 / 100
Story score
40 / 100
Engagement score
62 / 100
dingus [3188789]

Howdy!  With this script, if your buddy sends you an image link like "https://i.postimg.cc/pVYGHXh4/Brutalist1.png", it will automatically get turned into an embed in the chat!  

 

The script also supports youtube links, and select video formats.  Supported files will be listed below!  

jpg, jpeg, png, gif, webp, gifv, mp4, webm, ogg

 

 

 

Let me know if you run into any errors when using the script!  Any feedback is much appreciated.  

 

https://greasyfork.org/en/scripts/563081-torn-chat-link-embedder-youtube-multi-link

 

Non PDA compatible

Mr_Bob [479620]

I had to change one line to make it work for me

Line 74: const messageSpans = document.querySelectorAll('.message___pRfWR span.root___Xw4jI');

=>

const messageSpans = document.querySelectorAll('[class*="message"] span[class*="root"]');

 

also, why not combine this one with your other script?

dingus [3188789]

Not sure why you had to change a line, works perfectly for me!  Regarding why I don't combine them, I just haven't gotten around to it.  Soon, I'll be combining all of my mail and chat scripts into one communication helper script!  

tiksan [2383326]

I’d suggest looking at these MDN docs [1] as Torn’s build system will change the class names randomly.

 

[1]: https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Selectors/Attribute_selectors

Rosti [2840742]

Any chances of making the script functional again? The chat box names likely changed as did some other UI elements :)