Simple.

CEF and Fontawesome

Recommended Posts

Hello guys

I have problem when use fontawesome with cef

Showing a squares i try use link or download it but same problem

Share this post


Link to post

Did you optimise it for web?

 

A tool I use a lot:

fontsquirrel.com

 

  • Thanks 1

Share this post


Link to post

Problem sloved by using SVG Instead of CSS

But there is another question if I can include a web page via iframe in CEF browser ?

Share this post


Link to post
2 minutes ago, Simple. said:

Problem sloved by using SVG Instead of CSS

But there is another question if I can include a web page via iframe in CEF browser ?

I am very sure that CORS will block it, if it is from another domain.

https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS

 

 

But a way around that would be making a XMLHttpRequest

https://developer.mozilla.org/nl/docs/Web/API/XMLHttpRequest

 

And put the website inside of the contentWindow.

https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/contentWindow

Of course, there are some seriously limitations to this, as images, css, js are received with other requests.

 

So to answer your question: `It depends.`

If the CSS, JS, images and other content are embedded then there will be no problem.

 

 

  • Thanks 1

Share this post


Link to post
54 minutes ago, IIYAMA said:

I am very sure that CORS will block it, if it is from another domain. 

https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS

 

 

But a way around that would be making a XMLHttpRequest 

https://developer.mozilla.org/nl/docs/Web/API/XMLHttpRequest

 

And put the website inside of the contentWindow.

https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/contentWindow

Of course, there are some seriously limitations to this, as images, css, js are received with other requests. 

 

So to answer your question: `It depends.`

If the CSS, JS, images and other content are embedded then there will be no problem.

 

 

I tried to embed YouTube but didn't work
 

requestBrowserDomains ({"googlevideo.com", "ytimg.com", "ggpht.com", "youtube.com"})

 

Edited by Simple.

Share this post


Link to post
2 minutes ago, Simple. said:

I tried to embed YouTube but didn't work
 


requestBrowserDomains ({"googlevideo.com", "ytimg.com", "ggpht.com", "youtube.com"})

 

 

I don't think that is enough for just a Youtube video.

 

  1. Open your default browser.
  2. Go to the youtube video you want to watch.
  3. Open the inspector.
  4. Go to the network tab.
  5. Reload the page.
  6. And see the list of requests + domains showing up one by one.

 

 

  • Like 1

Share this post


Link to post
2 minutes ago, IIYAMA said:

 

I don't think that is enough for just a Youtube video.

 

  1. Open your default browser.
  2. Go to the youtube video you want to watch.
  3. Open the inspector.
  4. Go to the network tab.
  5. Reload the page.
  6. And see the list of requests + domains showing up one by one.

 

 

I used this method
But the browser is local, does that affect?

Share this post


Link to post
4 minutes ago, Simple. said:

I used this method
But the browser is local, does that affect?

yup

  • Like 1

Share this post


Link to post
11 minutes ago, Simple. said:

But the browser is local, does that affect? 

Yeah. If the browser is local, it's local only, and cannot communicate with the internet on it's own. This is because local browsers enable extended JavaScript functionality, namely, calling events etc. in MTA. If this was allowed, a malicious website would be able call events and exploit client-sided code, perhaps even the server-side integration of it. Browsers that can communicate with the internet, have that functionality disabled for that reason.

Technically you could get around this by loading the contents through fetchRemote and injecting that into a local browser, but as mentioned above, this would be very difficult to get images and anything else that loads in a separate request unless you parse the fetch's return as a browser would and make those additional requests through fetchRemote too. This would likely also be a lot slower than a non-local browser.

Edited by MrTasty
  • Like 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.