Jump to content
  • 0

CEF: problem with facebook


Wojak

Question

Facebook web page is not displaying properly in the browser build in MTA (it looks like all the HTML generated by javascript is missing).

All other pages seem to work, and the domain is whitelisted.

Also the page works fine in stand alone Chrome.

I'm using Windows 7 x64 and found one more user with the same system and same problem.

Since I didn't see this problem listed on bug tracker and I doubt that I'm the only one that tried to open facebook in MTA, this may by a rare bug...

Link to comment

2 answers to this question

Recommended Posts

  • 0

Facebook hosts many assets on CDNs like Akaimai, so that you have to request these as well.

You can figure them out by enabling the debug mode as described here: https://wiki.multitheftauto.com/wiki/CE ... #Debugging

Try this (some hosts are probably dynamic though and change over time):

requestBrowserDomains{"www.facebook.com", "facebook.com", "fbstatic-a.akamaihd.net", "pixel.facebook.com", "fbcdn-dragon-a.akamaihd.net", "scontent-vie1-1.xx.fbcdn.net"} 

Link to comment
  • 0

Thank You, You've put me on the right track :)

This solved the problem: https://wiki.multitheftauto.com/wiki/On ... rceBlocked

The default webbrowser resource doesn't handle this event... (adverts may be the reason why...)

Anyway this is what I did:

  
--in "WebBrowserGUI:constructor()" 
addEventHandler("onClientBrowserResourceBlocked", root, function(...) self:Browser_BrowserResourceBlocked(...) end) 
--in "WebBrowserGUI:Browser_WhitelistChange(whitelistedURLs)" at the beginning of the function 
if self.m_RequestedURL == "" then 
        self.m_RequestedURL = self.m_Browser:getBrowser():getURL() 
        self.m_Browser:getBrowser():loadURL(self.m_RequestedURL) 
        self.m_RequestedURL = "" 
        return 
end 
--in main chunk 
local blacklist = {["partner.googleadservices.com"]=true} -- this blocks the most annoying adverts on free forums 
function WebBrowserGUI:Browser_BrowserResourceBlocked(url, domain, reason) 
    local isBlocked = isBrowserDomainBlocked(url) 
    if isBlocked and not blacklist[domain] then 
        Browser.requestDomains({url}, true) 
        return 
    end 
end 
  

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...