No way to disable embedded images?

gorcorps

aka Brandon
Jul 18, 2004
30,739
454
126
Is there a way to disable embedded images? The old software had this and it made the forums much easier to follow. Without being able to disable these this place is a mess, and certainly not something I'd want to view outside of home.
 

ViRGE

Elite Member, Moderator Emeritus
Oct 9, 1999
31,516
167
106
It's not built into stock XenForo, it would seem. It has to be added as an add-on, or possibly a SFW site skin.
 

gorcorps

aka Brandon
Jul 18, 2004
30,739
454
126
Doh... well I guess I'll be more focused at work then, just a lot less active =P
 

waffleironhead

Diamond Member
Aug 10, 2005
7,024
526
136
That is unfortunate. Hopefully this can be implemented soon as I have a limited data allotment.
 

dullard

Elite Member
May 21, 2001
25,771
4,299
126
There is no way to turn off avatars?

For example, shortylickens now has a breast as his avatar. I like to browse while I'm running 1 to 3 minute experiments at work and can't really do anything practical during that short period of time. I can't browse now with porn as forced images.
 

ViRGE

Elite Member, Moderator Emeritus
Oct 9, 1999
31,516
167
106
For example, shortylickens now has a breast as his avatar. I like to browse while I'm running 1 to 3 minute experiments at work and can't really do anything practical during that short period of time. I can't browse now with porn as forced images.
Until they can get a suitable add-on, your best bet is probably to install AdBlock and use the element hiding helper. Or if you know CSS, then a Sylish script should work.

Avatars are .avatarHolder.is-expanded

Code:
@namespace url(http://www.w3.org/1999/xhtml);

@-moz-document domain("forums.anandtech.com") {
.sidebar {
  display:none;
}
.avatarHolder.is-expanded {
  display:none;
}
.hasRightSidebar .mainContent {
  margin-right: 20px;
  width: 100%;
}
}
 

Jeff7

Lifer
Jan 4, 2001
41,596
19
81
I also used the toggle for images and avatars while browsing during lunch or breaks at work.

Evidently Youtube videos can also be embedded now. That'll also need a checkbox to disable.
 

sm625

Diamond Member
May 6, 2011
8,172
137
106
Here is what it looks like under Opera with adguard and a bunch of filters:

MWSnap_2016_08_09_08_40_35.jpg
 

ViRGE

Elite Member, Moderator Emeritus
Oct 9, 1999
31,516
167
106
Upon further reflection, the issue is that while it's easy to hide the images with CSS, it's hard to change images into URLs, which is what we'd want for inline images. Even XenForo doesn't make this easy, from what I'm reading. I'm not sure there's a current add-on (or skin) that actually supports disabling inlines...
 

Jaskalas

Lifer
Jun 23, 2004
35,106
9,227
136
If Xenforo supports addons, the first step is to figure out how to apply a filter to Message Content. Second step is finding the code used elsewhere to do just this task. Add the two together and the addon would be "complete". It's not a complicated project, but I imagine someone developing it would need a forum to to test development.

Thinking about it, the most "complicated" part might be adding the user option to enable / disable the addon's functionality.
 

Kev

Lifer
Dec 17, 2001
16,367
4
81
Upon further reflection, the issue is that while it's easy to hide the images with CSS, it's hard to change images into URLs, which is what we'd want for inline images. Even XenForo doesn't make this easy, from what I'm reading. I'm not sure there's a current add-on (or skin) that actually supports disabling inlines...

I'm surprised this is not a default feature. Basically it kills the forum for me.
 

Jaskalas

Lifer
Jun 23, 2004
35,106
9,227
136
It should be possible with greasemonkey if you want to try your hand at javascript.

No need for the unfamiliar to "try their hand". I just installed Grease Monkey for this purpose.
For my first pass, this turns any message image into a link. Note it does not cover every possibility, such as when you reply to a post with images.

Code:
// ==UserScript==
// @name  ImgReplace
// @namespace  forums.anandtech.com/
// @description Replace IMG tag with Link to IMG in messages
// @version  1
// @grant  none

// Select Images to Replace
var tags = document.querySelectorAll('img.bbCodeImage');

// This loops over all of the <img> tags.
for (var i = 0; i < tags.length; i++) {

  // This replaces the img with a link
  var tagURL = tags[i].src;
  tags[i].outerHTML = '<a href="'+tagURL+'" target="_blank" class="externalLink" rel="nofollow">'+tagURL+'</a>';
}

// ==/UserScript==
 
  • Like
Reactions: Jodell88

Jaskalas

Lifer
Jun 23, 2004
35,106
9,227
136
In attempting to handle the reply boxes / quotes... I need to find a javascript function to intercept the content as soon as it loads or exists in the iframe.

What I've got so far is this:
Code:
 $(document.getElementsByClassName("redactor_MessageEditor")[0]).load(function(){
  //Do Stuff
}
It lets me replace images when the frame first loads, but not if you click reply... because the script isn't running at that time.
Anyone well versed in Javascript and front end DOM manipulation?

I suppose a fallback method is to use CSS to hide the images by default... then loop the function to replace them with a link. There'd be some performance "issues" and a slight delay before they appeared...but it'd effectively do what we want with the reply box.