Using Chrome extension in CefSharp

5,640 views
Skip to first unread message

Yordan Terziev

unread,
Oct 22, 2013, 11:59:56 AM10/22/13
to cefs...@googlegroups.com
Hello All,

Is there a way to register a chrome extension in CefSharp ? Is it generally possible in CEF ?

Thank you in advance !!

Yordan




Per Lundberg

unread,
Oct 22, 2013, 2:49:06 PM10/22/13
to cefs...@googlegroups.com
Hi,

No, it's not possible. See this thread: http://magpcss.org/ceforum/viewtopic.php?f=6&t=10242

Generally, if you "want it to act exactly like Chrome, use Google Chrome". :) CefSharp is not intended to support everything that Chrome does. It's more as a form of "browser lego", to make it possible to e.g. render existing web pages in your application, or build the UI with HTML/Javascript instead of C#/VB.NET.

As such, it doesn't support everything Chrome does, and does not need to either, since the use case is slightly different.

Now, let me ask you one question in return: why would you want it to support Chrome extensions? :) What extension(s) would you like to use it for, more specifically?

Best regards,
Per

Yordan Terziev

unread,
Oct 22, 2013, 3:43:31 PM10/22/13
to cefs...@googlegroups.com
Hi Per,

We use CefSharp together with pdf.js (http://mozilla.github.io/pdf.js/) as a PDF viewer in our C# application ( for a research project).

Currently i am loading the pdf.js viewer from the local file system, but having some cross origin troubles when fetching a remote PDF Document.
e.g.: (XMLHttpRequest cannot load http://www.adobe.com/content/dam/Adobe/en/products/acrobat/pdfs/adobe-acrobat-xi-esign-pdf-file-tutorial-ue.pdf. Origin file:// is not allowed by Access-Control-Allow-Origin.)

I found this thread here (http://magpcss.org/ceforum/viewtopic.php?f=6&t=10567) which says that the problem should resolve when using some custom scheme other than file://(because of the special handling). So i implemented a custom scheme handler, but still haven't got it to work correctly :). 

Since i have a ready pdf.js extension for chrome, i was just wondering if i am missing something using CefSharp.

Thank you for the quick response and thank you for the great project :)

Best regards,
Yordan

Per Lundberg

unread,
Oct 23, 2013, 1:58:06 PM10/23/13
to cefs...@googlegroups.com
OK, I see. No immediate ideas unfortunately, but please let us know if/when you manage to fix it.

Thanks for the nice words. Cannot take credit for the project though, it was started long before I found out about it. :) Just doing my best to improve pieces here and there and bring it up to recent Chromium/CEF work etc.

Best regards,
Per

Tom Deblauwe

unread,
May 20, 2015, 9:35:44 AM5/20/15
to cefs...@googlegroups.com
Hello,

Did you fix it with that version? And how? :)

Best regards,
Tom,

Christian LeMoussel

unread,
May 21, 2015, 12:42:55 PM5/21/15
to cefs...@googlegroups.com
Hi Yordan

For Origin file:// is not allowed by Access-Control-Allow-Origin.) error, you can set this settings

                browser.BrowserSettings.FileAccessFromFileUrlsAllowed = true;
                browser
.BrowserSettings.UniversalAccessFromFileUrlsAllowed = true;
                browser
.BrowserSettings.WebSecurityDisabled = true;

BR,

Christian.
Reply all
Reply to author
Forward
0 new messages