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

Styles not applied on first pageload? #43

Open
remcokalf opened this issue Jan 8, 2018 · 4 comments
Open

Styles not applied on first pageload? #43

remcokalf opened this issue Jan 8, 2018 · 4 comments

Comments

@remcokalf
Copy link

I have several websites with custom styles, e.g. for setting ad containers to display: none.

The CSS works fine, but is not applied on first page load.
On a refresh of a page, the styles work. Also on a toggle within the menu bar button.

Using Safari 11.0.2 on macOS 10.13.2

@350d
Copy link
Owner

350d commented Jan 8, 2018

Hello! Can you please attach your style here and websites urls?

@remcokalf
Copy link
Author

I have this happening with several sites. One example:

https://www.nu.nl

The styles in this case hide all the ads by setting containers to display: none.
Also see attached screenshot.

First page load: all ads visible, CSS not applied.
Reload, or apply styles through Stylish button: CSS is applied: styles gone.

#header {display: none !important;}
#content_container {margin-top: 10px !important;}
.block.cts {display: none !important;}
embed {display: none !important;}
.section-advertorial {display: none !important;}
.advertoriallist {display: none !important;}
.nu-blendle-widget {display: none !important;}
.consent-bar-show-large,
#sanoma-consent-bar-mobile {display: none !important;}
html {margin-top: 0 !important;}
.stickyads-overlay {display: none !important;}
#stage, #Stage, #stage *, #Stage * { display: none !important;}
#billboardContainer { display: none !important;}
.adblock_h { min-height:30px !important; height:30px !important;}
.adblock_h *, #adblock_v * { display:none !important;}
.adblock_noborder, #adblock_v, .adblock_m { display:none !important;}
iframe { display:none !important;}
div[id^=scr_] { display:none !important;}
.wtf-advertorial { display:none !important;}
#eyeDiv {display: none !important;}
#pageheader {min-height: 0 !important;}
#pageheader, #webring .inner-content {min-height:60px !important; max-height: 60px !important;}
object {display:none !important;}
#webring .inner-content div{ display:none !important;}
.block.cts {display:none !important;}
body {background-image: none !important;}
.section.adblue {display: none;}
.section.advertorialwidget {display: none;}

schermafbeelding 2018-01-09 om 10 38 10

Repository owner deleted a comment from alex-polosky Jan 19, 2018
@350d
Copy link
Owner

350d commented Jan 19, 2018

What version of Stylish you using here? Works fine in my build, can you test? #37

@remcokalf
Copy link
Author

I am using:
Stylish 2.0.8
Safari 11.02(build 13604.4.7.1.6) on macOS 10.13.2

I also tried your 2.0.9 beta from the #37 thread, but it does the same.

I checked the source code of the page for what is happening.
What I see is happening (with 2.09 installed), is that the custom styles are inserted near the bottom of the main html and near the bottom of every iframe.

On first pageload though, the insertion near the bottom of the main html is not there (the insertions in iframes are there). Only after a refresh, the insertion near the bottom is there, and styles are applied.

See attached screenshot for a before and after.

image 2018-01-19 at 11 33 21 am

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

No branches or pull requests

2 participants