__ns__pop2top class breaks multi-column layouts, e.g. bootstrap

Ask for help about NoScript, no registration needed to post
Quix0r
Posts: 1
Joined: Tue Nov 28, 2017 10:29 am
Location: Krefeld
Contact:

__ns__pop2top class breaks multi-column layouts, e.g. bootstrap

Post by Quix0r » Tue Mar 30, 2021 11:29 am

Hello developers.

I have found out that NoScript sometimes adds a __ns__pop2top CSS class with an ultra-high z-index to the DOM document. An example of this annoyance is shown below:
Image

This happens when the said software adds more items for "infinite-scrolling" through more posts. Can you please check if this is still needed? Or how can I prevent this from happening? Sure I don't wish to uninstall NoScript. :-)
Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Firefox/78.0

barbaz
Senior Member
Posts: 10060
Joined: Sat Aug 03, 2013 5:45 pm

Re: __ns__pop2top class breaks multi-column layouts, e.g. bootstrap

Post by barbaz » Tue Mar 30, 2021 6:00 pm

Does that element contain any blocked content, e.g. a video?

Can you work around this with a Stylus style for the specific site?
*Always* check the changelogs BEFORE updating that important software!
-

qwert
Posts: 1
Joined: Sun Nov 21, 2021 9:42 pm

Re: __ns__pop2top class breaks multi-column layouts, e.g. bootstrap

Post by qwert » Sun Nov 21, 2021 10:05 pm

barbaz wrote:
Tue Mar 30, 2021 6:00 pm
Does that element contain any blocked content, e.g. a video?
I can't speak for OP but for similar web software (Misskey) it happens as soon as there is an audio track from a 3rd party website embedded in the column. For some reason this does not happen for images or videos from 3rd parties despite the settings for the "Default" trust level being to disallow media.

For videos what happens is that they are by default just displayed as an empty player (i.e. no thumbnail, but the final size). Clicking on it once creates a NoScript overlay which, when clicked on, opens a "NoScript Blocked Objects - Allow <MEDIA>" window to select to allow the specific file, domain or collapse blocked objects. While the NoScript overlay is visible, the __ns__pop2top is applied to the column.

For embedded audio files the mentioned NoScript overlay as well as the __ns__pop2top are present/applied without me interacting with the element. The behaviour after that is the same.
barbaz wrote:
Tue Mar 30, 2021 6:00 pm
Can you work around this with a Stylus style for the specific site?
I have not tested it and am not familiar with Stylus so please correct me if I'm wrong but because the CSS has !important on it like this:

Code: Select all

.__ns__pop2top {
    z-index: 2147483647 !important;
}
I think it would not be possible to overwrite it?

IMHO if there is no easy solution it would be a better idea to allow the __ns__pop2top CSS class to be disabled in settings if that's possible.

version info: NoScript 11.2.11 - Firefox 94.0.1 (Windows)

edit: to clarify, this is about content from 3rd party websites that is integrated into the (already trusted) site
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:94.0) Gecko/20100101 Firefox/94.0

barbaz
Senior Member
Posts: 10060
Joined: Sat Aug 03, 2013 5:45 pm

Re: __ns__pop2top class breaks multi-column layouts, e.g. bootstrap

Post by barbaz » Mon Nov 22, 2021 2:32 am

Ok, found a way to test this myself and looks like neither Stylus nor even userContent.css can override this directly.

Maybe the only answer, if this should be addressed (which I'm not sure) would be for NoScript to have an Advanced option where user can specify a list of sites where pop2top causes conflicts and thus should not be applied?

For now you could try something like the following Violentmonkey user script, but even this didn't get consistent results for me. Change the @match to the specific site where pop2top is a problem for you (you can add multiple @match lines if you need this on multiple sites).

Code: Select all

// ==UserScript==
// @name        NoScript Don't Pop2top
// @author      barbaz
// @namespace   Violentmonkey Scripts
// @version     1.0
// @match       *://DOMAIN.WHERE.THIS.IS.A.PROBLEM.GOES.HERE/*
// @inject-into content
// @run-at      document-start
// @grant       none
// ==/UserScript==

let m = new MutationObserver(function(records) {
  for (let r of records) {
    if (r.target.classList.contains('__ns__pop2top')) {
      //console.log(r.target.classList);
      r.target.classList.remove('__ns__pop2top');
      //console.log(r.target.classList);
    }
  }
});
m.observe(document.documentElement, {
  attributes: true,
  subtree: true,
  attributeFilter: ["class"],
});
*Always* check the changelogs BEFORE updating that important software!
-

Post Reply