Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hidden element appears again on saved Page #840

Open
waleed-wwn opened this issue Dec 15, 2021 · 3 comments
Open

Hidden element appears again on saved Page #840

waleed-wwn opened this issue Dec 15, 2021 · 3 comments

Comments

@waleed-wwn
Copy link

@waleed-wwn waleed-wwn commented Dec 15, 2021

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
@gildas-lormeau
Copy link
Owner

@gildas-lormeau gildas-lormeau commented Dec 17, 2021

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.

@invobzvr
Copy link

@invobzvr invobzvr commented Jan 1, 2022

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...

@gildas-lormeau
Copy link
Owner

@gildas-lormeau gildas-lormeau commented Jan 4, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants