Main Forum Closed.
Stylish can't auto apply style to some websites in latest version Chrome
Sorry for my poor English X_X
Today I get a feedback for my stylish
http://userstyles.org/styles/91391/theme
The style is for www.baidu.com ,it's the largest search engine in China
He say the style can't auto apply in results page, I tested it and found that this problem does exist, I also tried to download other styles, and all of them can't be auto applied either.
The problem is only show in the lastest version Chrome, so how can I fix it ?
Today I get a feedback for my stylish
http://userstyles.org/styles/91391/theme
The style is for www.baidu.com ,it's the largest search engine in China
He say the style can't auto apply in results page, I tested it and found that this problem does exist, I also tried to download other styles, and all of them can't be auto applied either.
The problem is only show in the lastest version Chrome, so how can I fix it ?
Comments
Also (may be related) I see hideheader's Stylish for Chrome: Fit the editor to its content technique no longer works. I believe this is also new as of latest Chrome (Version 33.0.1750.146 m) on Windows 7.
https://codereview.chromium.org/64843004
https://codereview.chromium.org/66383005/
http://stackoverflow.com/questions/21207474/custom-css-stop-to-work-in-32-0-1700-76-m-google-chrome-update
I know it may can be fixed by user script, but I don't think it's a good idea...
That removal of true user stylesheets that got into cascade other way than DOM injection seems like a terrible change. Isn't it against specs?
One solution is to attach Stylish STYLEs to documentElement instead of to HEAD. Another is to monitor deletions on HEAD with a MutationObserver, identify your own removedNodes, and reattach them.
https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver I don't think Chromeo understood when he filed that issue that USER sheets are fundamentally an accessibility feature - that's why they can trump AUTHOR sheets in the cascade, and it's likely the reason why custom.css was applied to the chrome:// URIs in the first place.
(And if anyone feels strongly about losing this functionality, it shouldn't be hard to persuade Google to restore it by appealing to their "don't be evil" mantra.) https://chromium.googlesource.com/chromium/blink.git/+/master/Source/web/WebDocument.cpp
https://codereview.chromium.org/154113008/
It's not exposed to Javascript, though.
It's not as simple as using Stylish, but it's the best you can do now. If this is what you meant by "fixed by user script", then you are stuck.
If you'll be installing Baidu styles frequently, you can add Userstyles.org to Chrome's whitelist so that you can install by clicking the link instead of right-click/save/drag+drop.
http://www.chromium.org/administrators/policy-list-3#ExtensionInstallSources
I'll try to tell users how to add Userstyles.org to whitelist...
BTW,I find if I search from adressbar or right-click menu at selected text (Baidu is my default search engine), styles can be applied as usual.
The different between them is the search parameter:
if I search from the index page,the results page's adress is like
http://www.baidu.com/#wd=Chrome
and search from adressbar or right-click menu it's like
http://www.baidu.com/s?ie=UTF-8&wd=Chrome
It looks like the first way to search is request the data from the second way, and rewrite it to the page... I can't understand why Baidu do like that, it doesn't make sense...
Thank u very much! :x