SingleFile icon indicating copy to clipboard operation
SingleFile copied to clipboard

Hidden element appears again on saved Page

Open waleed-wwn opened this issue 3 years ago • 3 comments

I am using "SingleFile addon in Firefox and selected "Remove hidden elements" on HTML content. I also use "uBlock Origin".

Problem: element successfully hidden in real view { Before Saved }, But after save page by using "SingleFile" the hidden element appears again on saved Page.

To Reproduce on this page https://excelmacromastery.com/vba-listbox/ I added below filter on uBlock to remove an element: ! 2021-12-14 https://excelmacromastery.com ||excelmacromastery.com/wp-content/themes/flat/assets/img/default-background.jpg

Expected behavior the hidden element should not appears again on saved Page

Screenshots 1 2 3

Environment

  • OS: Windows 11 Pro 21H2
  • Browser: Firefox 95
  • SingleFile 1.19.22

waleed-wwn avatar Dec 15 '21 11:12 waleed-wwn

Thank you. The CSS rules added by uBlock Origin cannot be directly seen by other extensions. Actually, SingleFile detects hidden elements by testing the size of the element. That's why it cannot detect the background image is not displayed. I'll try to see if I can improve the implementation to detect hidden background images.

gildas-lormeau avatar Dec 17 '21 23:12 gildas-lormeau

The uBlock Origin should block the image request, so how was that resource being loaded? caches?

Thank you. The CSS rules added by uBlock Origin cannot be directly seen by other extensions. Actually, SingleFile detects hidden elements by testing the size of the element. That's why it cannot detect the background image is not displayed. I'll try to see if I can improve the implementation to detect hidden background images.

What about using getComputedStyle(el).display to detect hidden element, though this may cost much...

invobzvr avatar Jan 01 '22 09:01 invobzvr

That's already what SingleFile is doing. It's also checking the size of the element. However, this technique does not always work with blocked background images because the container element is not necessarily hidden.

gildas-lormeau avatar Jan 04 '22 23:01 gildas-lormeau