Jump to content

CEF and Fontawesome


Simple.

Recommended Posts

  • Moderators
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
Link to comment
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.
Link to comment
  • Moderators
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
Link to comment
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?

Link to comment
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
Link to comment

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.
×
×
  • Create New...