How to change the style of scrollbar?

Do not post support requests, bug reports or feature requests. Discuss CEF here. Non-CEF related discussion goes in General Discussion!

Re: How to change the style of scrollbar?

Postby magreenblatt » Sun Jun 05, 2011 7:23 pm

cagret wrote:I have the same problem as shenhui, can't set user stylesheet for web pages.

Code: Select all
browserDefaults.user_style_sheet_enabled = true;
CefString(&browserDefaults.user_style_sheet_location).FromASCII("file://D:/.../proto3/shared.css");
browserDefaults.universal_access_from_file_urls_allowed = true;
browserDefaults.file_access_from_file_urls_allowed = true;


I even set "universal_access_from_file_urls_allowed" and "file_access_from_file_urls_allowed" but it doesn't help.
Setting the path to "D:/.../proto3/shared.css" (no file://) also doesn't help.
The file exists - 100% tested.
The styles in CSS also work - 100% tested.

Just to be clear -- are you saying that your user style sheet is being loaded by CEF to style other things but fails to style scroll bars? What is being styled successfully? Can you provide your CSS file?

Thanks,
Marshall
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm

Re: How to change the style of scrollbar?

Postby cagret » Sun Jun 05, 2011 7:34 pm

I'm not talking about no specific styles, just any styling does not work.

My shared.css:

body {
color: red;
}

In my index.html I include it by adding:
<link rel=stylesheet href="shared.css" />

And the text is red.
I try to do the same using user stylesheet, but it doesn't work (I remove that <link> and try to include that css file by setting browserDefaults.user_style_sheet_location)

I've been setting other settings in browserDefaults and they work, only user stylesheet doesn't.
User avatar
cagret
Techie
 
Posts: 41
Joined: Fri Mar 11, 2011 11:42 am
Location: Poland

Re: How to change the style of scrollbar?

Postby cagret » Sun Jun 05, 2011 8:28 pm

I've tried other things, but still no luck.
Uploaded both index.html and shared.css to a website, I thought maybe it was a bug that appeared only for "file://", so I tried "http://", but nothing changed.
I've checked for the 5th time the path to shared.css and it is valid, the contents of that css is also valid, checked it many times.
I've played with other settings, I thought maybe there is a conflict and removed the code that changed other settings, but still nothing.
User avatar
cagret
Techie
 
Posts: 41
Joined: Fri Mar 11, 2011 11:42 am
Location: Poland

Re: How to change the style of scrollbar?

Postby cagret » Mon Jun 06, 2011 7:23 am

Should I create an Issue for this?
User avatar
cagret
Techie
 
Posts: 41
Joined: Fri Mar 11, 2011 11:42 am
Location: Poland

Re: How to change the style of scrollbar?

Postby magreenblatt » Mon Jun 06, 2011 8:31 am

cagret wrote:Should I create an Issue for this?

Please do.
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm

Re: How to change the style of scrollbar?

Postby shenhui » Wed Jul 13, 2011 4:51 am

We have successfully inserted the css into CEF, as we should first read the content from .css file, then encoding the content in base64 format and append the content at the tail of a dependent string("data:text/css;charset=utf-8;base64,"), in the end, pass the string into user_style_sheet_location.

Code: Select all
browserDefaults.user_style_sheet_enabled = true;
CefString(&browserDefaults.user_style_sheet_location).FromASCII("data:text/css;charset=utf-8;base64,csscontent");
browserDefaults.universal_access_from_file_urls_allowed = true;
browserDefaults.file_access_from_file_urls_allowed = true;


in the code above, csscontent is shorten for the base64 formatted content.
shenhui
Techie
 
Posts: 31
Joined: Sat Apr 16, 2011 10:50 pm

Previous

Return to CEF Discussion

Who is online

Users browsing this forum: No registered users and 38 guests