Custom CSS for scroll bar

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Custom CSS for scroll bar

Postby nanobill » Wed Aug 24, 2016 3:16 pm

Hi,

I am having a hard time with the execution of custom Javascript to modify the scrollbar.

I've tried ExecuteJavaScript in OnLoadStart & OnLoadEnd (sometimes it works, sometimes it doesn't, sometimes it flickers).
Then, I decided to try CefRegisterExtension, finally realized that the document object model is not loaded before the extension. I went ahead and tried to create a custom extension, based on a chrome extension. It did not work either. And finally, decided to move OnLoadStart & OnLoadEnd to my Renderer Class, and implemented GetRenderProcessHandler(), and...didn't work.

I'm hoping someone could guide me through the process of successfully implementing a custom design for the scroll bar.

Thank you for your time.
nanobill
Newbie
 
Posts: 9
Joined: Tue Aug 23, 2016 7:39 pm

Re: Custom CSS for scroll bar

Postby nanobill » Thu Aug 25, 2016 10:40 am

I'm starting to think this is a bug with cef. Did anyone successfully implement a custom scrollbar? If you did, try refreshing the page constantly, you'll see that the default scrollbar appears, and creates flickering. Sometimes, the custom scrollbar doesn't even appear. The javascript I have created uses the DOMContentLoaded event. Even with that, that javascript doesn't even inject the css sometimes, it's just random. Seems like an issue with the way cef handles OnLoadStart. Please advise.
nanobill
Newbie
 
Posts: 9
Joined: Tue Aug 23, 2016 7:39 pm

Re: Custom CSS for scroll bar

Postby magreenblatt » Thu Aug 25, 2016 10:48 am

We need to add a new callback to do this reliably. See https://bitbucket.org/chromiumembedded/cef/issues/1454.

Do you control the content being loaded in the browser? If so, change the CSS style in the content.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Custom CSS for scroll bar

Postby nanobill » Thu Aug 25, 2016 10:55 am

I will try to see what I can do. I've compiled CEF from source, I might be able to create that callback for the official source.
nanobill
Newbie
 
Posts: 9
Joined: Tue Aug 23, 2016 7:39 pm

Re: Custom CSS for scroll bar

Postby fddima » Thu Aug 25, 2016 1:05 pm

May be have sense try to extend user agent styles?
fddima
Master
 
Posts: 788
Joined: Tue Dec 07, 2010 6:10 am

Re: Custom CSS for scroll bar

Postby nanobill » Thu Aug 25, 2016 1:55 pm

My team and I have successfully implemented the OnDidCreateDocumentElement callback for the CefLoadHandler / Also updated the wrapper. Not sure how to push that update to the public though. We're now implementing the insertStyleSheet function to work correctly with Documents when that callback is called.
nanobill
Newbie
 
Posts: 9
Joined: Tue Aug 23, 2016 7:39 pm

Re: Custom CSS for scroll bar

Postby fddima » Thu Aug 25, 2016 2:02 pm

nanobill wrote:Not sure how to push that update to the public though.

Creating pull request looks like a best way. Also check https://bitbucket.org/chromiumembedded/ ... WithGit.md , probably it will be helpful for you.
fddima
Master
 
Posts: 788
Joined: Tue Dec 07, 2010 6:10 am

Re: Custom CSS for scroll bar

Postby nanobill » Thu Aug 25, 2016 3:21 pm

Update #2

insertStyleSheet function has been successfully implemented in CefDOMDocument, which can be used with OnDidCreateDocumentElement.

I would like to push the update to the public, but the problem is, we're using a local build with quite a lot of modified code. Please advise.
nanobill
Newbie
 
Posts: 9
Joined: Tue Aug 23, 2016 7:39 pm

Re: Custom CSS for scroll bar

Postby magreenblatt » Fri Aug 26, 2016 3:27 am

nanobill wrote:Update #2

insertStyleSheet function has been successfully implemented in CefDOMDocument, which can be used with OnDidCreateDocumentElement.

I would like to push the update to the public, but the problem is, we're using a local build with quite a lot of modified code. Please advise.

https://bitbucket.org/chromiumembedded/ ... l-requests
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Custom CSS for scroll bar

Postby fddima » Fri Aug 26, 2016 5:24 am

nanobill wrote:Update #2

insertStyleSheet function has been successfully implemented in CefDOMDocument, which can be used with OnDidCreateDocumentElement.

I would like to push the update to the public, but the problem is, we're using a local build with quite a lot of modified code. Please advise.


Does it possible make this universal? I.e. allow insert any element?
fddima
Master
 
Posts: 788
Joined: Tue Dec 07, 2010 6:10 am

Next

Return to Support Forum

Who is online

Users browsing this forum: No registered users and 72 guests