__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 »

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: 10841
Joined: Sat Aug 03, 2013 5:45 pm

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

Post by barbaz »

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 »

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: 10841
Joined: Sat Aug 03, 2013 5:45 pm

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

Post by barbaz »

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!
-
barbaz
Senior Member
Posts: 10841
Joined: Sat Aug 03, 2013 5:45 pm

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

Post by barbaz »

An example URL that doesn't require login to see this problem: https://github.com/uBlockOrigin/uBlock- ... ssues/1720
*Always* check the changelogs BEFORE updating that important software!
-
User avatar
Giorgio Maone
Site Admin
Posts: 9454
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

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

Post by Giorgio Maone »

I'm actually thinking of entirely removing the forced z-index trick, which was there primarily to force the placeholder to be shown on sites where it would be normally hidden until actually playing.
I'll run some experiments on major sites (Youtube, I'm looking at you) and check if it can fly, leaving the most exotic edge cases to the popup menu.
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:96.0) Gecko/20100101 Firefox/96.0
pLineVal
Posts: 1
Joined: Sat Jun 18, 2022 6:21 am

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

Post by pLineVal »

Giorgio Maone wrote: Sun Dec 26, 2021 9:13 pm I'm actually thinking of entirely removing the forced z-index trick, which was there primarily to force the placeholder to be shown on sites where it would be normally hidden until actually playing.
I'll run some experiments on major sites (Youtube, I'm looking at you) and check if it can fly, leaving the most exotic edge cases to the popup menu.
please do, another major site that has this issue is discord, though this could be addressed to them instead. It seemingly shows up at random(not really) but it blocks ALL popups, e.g profiles, images... I end up having to remove __ns__pop2top from body in devtools daily
Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Firefox/91.0
Post Reply