Jusonex Posted February 12, 2015 Author Share Posted February 12, 2015 That would require a way to modify the useragent, either directly or via a function like setBrowserViewMode(browser, "mobile"). Also, since there is no way to inject Javascript code into browsers in remote mode, it might be worth considering adding something like callBrowserSpecialCommand that allows you for example to play or pause a YouTube video instead of many specialised functions. Link to comment
Castillo Posted February 12, 2015 Share Posted February 12, 2015 Well, it would be nice to have it, if it's possible and not too much of a mess to add such function. Link to comment
.:HyPeX:. Posted February 13, 2015 Share Posted February 13, 2015 That would require a way to modify the useragent, either directly or via a function like setBrowserViewMode(browser, "mobile").Also, since there is no way to inject Javascript code into browsers in remote mode, it might be worth considering adding something like callBrowserSpecialCommand that allows you for example to play or pause a YouTube video instead of many specialised functions. Wouldnt in the case of Youtube a key injection do the trick? Link to comment
neves768 Posted February 13, 2015 Share Posted February 13, 2015 Jusonex, allow any websites like: own websites, Google, Bing and others. Freedom! Link to comment
JR10 Posted February 13, 2015 Share Posted February 13, 2015 It's not that simple. The main problem I see at the moment is the potential abuse capability: A server would be able to open every webpage it wants to - including porn and warez. There should be in any case an option to turn the entire webbrowser stuff off. Link to comment
.:HyPeX:. Posted February 13, 2015 Share Posted February 13, 2015 It's not that simple. The main problem I see at the moment is the potential abuse capability: A server would be able to open every webpage it wants to - including porn and warez. There should be in any case an option to turn the entire webbrowser stuff off. What about letting the client have a setting wich can be turned off only from the MTA Settings wich limits the pages to only load the whitelisted ones? - So clients can at their own risk disable this safety measure. Link to comment
Castillo Posted February 13, 2015 Share Posted February 13, 2015 They already placed a whitelist system, the scripts can request pages and the client has to allow or not if he wants to see them. Link to comment
.:HyPeX:. Posted February 13, 2015 Share Posted February 13, 2015 They already placed a whitelist system, the scripts can request pages and the client has to allow or not if he wants to see them. Yeah, but isnt the whitelist dependant on the script itself downloaded from the server? the server can still whitelist whatever it wants and send it to clients Link to comment
Jusonex Posted February 13, 2015 Author Share Posted February 13, 2015 No, the white- and blacklist is MTA global and managed by the MTA team. URLs that are neither whitelisted nor blacklisted can/have to be requested via requestBrowserDomains/Browser.requestDomains (plus the player must accept the request) Link to comment
.:HyPeX:. Posted February 13, 2015 Share Posted February 13, 2015 No, the white- and blacklist is MTA global and managed by the MTA team. URLs that are neither whitelisted nor blacklisted can/have to be requested via requestBrowserDomains/Browser.requestDomains (plus the player must accept the request) But isnt the script wich answers this request? (I.e, a scripted fake signal couldnt do it?) Link to comment
Jusonex Posted February 13, 2015 Author Share Posted February 13, 2015 No. The following window opens after executing Browser.requestDomains{"nyan.cat"} scripted fake signal couldnt do it? A "fake signal" is not possible as the GUI window is created by MTA. Link to comment
.:HyPeX:. Posted February 13, 2015 Share Posted February 13, 2015 No. The following window opens after executing Browser.requestDomains{"nyan.cat"} scripted fake signal couldnt do it? A "fake signal" is not possible as the GUI window is created by MTA. Oh. Great then Link to comment
neves768 Posted February 13, 2015 Share Posted February 13, 2015 No. The following window opens after executing Browser.requestDomains{"nyan.cat"} scripted fake signal couldnt do it? A "fake signal" is not possible as the GUI window is created by MTA. With my tests, i can't access nyan.cat: I allow, but the page don't load. I tested with your scripts examples. Link to comment
Jusonex Posted February 13, 2015 Author Share Posted February 13, 2015 Try restarting the resource for now. The example resources on GitHub don't call loadURL again after allowing the request. I'll add the missing code soon. Link to comment
neves768 Posted February 13, 2015 Share Posted February 13, 2015 Your 2D Code from https://wiki.multitheftauto.com/wiki/User:Jusonex works? Newest updated code from github is working now? Link to comment
Jusonex Posted February 13, 2015 Author Share Posted February 13, 2015 Oh yeah, that example is very old. I meant https://github.com/Jusonex/mtasa_cef_tools (there is a download button on the right). Link to comment
neves768 Posted February 13, 2015 Share Posted February 13, 2015 I tested it too. http://twitch.tv/ return a blank page, i can't close the window and i can't change the URL(woovies_browser). I'm using MTA:SA 1.5 from https://nightly.multitheftauto.com/mtasa-1.5-full ... 150205.exe Link to comment
Jusonex Posted February 13, 2015 Author Share Posted February 13, 2015 Could you please tell me exact steps to reproduce? Link to comment
neves768 Posted February 13, 2015 Share Posted February 13, 2015 1- http://prntscr.com/64nc2r 2- restart woovies_browser on console 3- Press 'b' in-game and oppear a window, but with blank page. Youtube and default websites from webswitcher resource are working normally. Link to comment
Jusonex Posted February 13, 2015 Author Share Posted February 13, 2015 You did not request any Twitch domain. Replace line 12 by: browser.pages = requestBrowserDomains({"google.com", "youtube.com", "twitch.tv", "pandora.com", "twitch.tv", "www.twitch.tv", "static-cdn.jtvnw.net", "www-cdn.jtvnw.net", "api.twitch.tv", "web-cdn.ttvnw.net", "media-cdn.twitch.tv"}) Unfortunately, Twitch loads data from many domains, so I might missed some. I think we will add Twitch to the whitelist before release. You can display blocked URLs as follows: 1.) Start runcode 2.) /debugscript 3 3.) /crun setDevelopmentMode(true) Link to comment
neves768 Posted February 13, 2015 Share Posted February 13, 2015 You did not request any Twitch domain.Replace line 12 by: browser.pages = requestBrowserDomains({"google.com", "youtube.com", "twitch.tv", "pandora.com", "twitch.tv", "www.twitch.tv", "static-cdn.jtvnw.net", "www-cdn.jtvnw.net", "api.twitch.tv", "web-cdn.ttvnw.net", "media-cdn.twitch.tv"}) Unfortunately, Twitch loads data from many domains, so I might missed some. I think we will add Twitch to the whitelist before release. You can display blocked URLs as follows: 1.) Start runcode 2.) /debugscript 3 3.) /crun setDevelopmentMode(true) Needs subdomain too. Okay! You can add something like *.domain.ext/* ? TY for the fast reply and solution Now i understand the needs of the system. What's missing for the release? Optimization? Link to comment
Jusonex Posted February 13, 2015 Author Share Posted February 13, 2015 You can add something like *.domain.ext/* ? No. MTA's hardcoded whitelist supports wildcard domains, but allowing wildcards to be requested is a security risk. We might reduce the security restrictions later a bit, but it's usually better to start with too many than with insufficient security restrictions. What's missing for the release? Optimization? People doing intensive testing. My ToDo list is atm nearly empty. Link to comment
neves768 Posted February 22, 2015 Share Posted February 22, 2015 You can add something like *.domain.ext/* ? No. MTA's hardcoded whitelist supports wildcard domains, but allowing wildcards to be requested is a security risk. We might reduce the security restrictions later a bit, but it's usually better to start with too many than with insufficient security restrictions. What's missing for the release? Optimization? People doing intensive testing. My ToDo list is atm nearly empty. I'm back to the post. You see the mouse position? When you click at a position with your mouse the action will be a little up Link to comment
Sasu Posted February 22, 2015 Share Posted February 22, 2015 Two questions: *- Is there anyway to set an alpha value to the browser with webui? *-What does transparent value(createBrowser) do? Because I can't see the difference. And finally good work with CEF, it is awesome that you integrated it to mta 1.5. I can't wait anymore. Link to comment
Jusonex Posted February 22, 2015 Author Share Posted February 22, 2015 *-What does transparent value(createBrowser) do? Because I can't see the difference If transparent is set to false, the background will be an opaque white (if no other color was explicitly specified in the HTML file). If transparent is set to true on the other hand, the default background will be transparent by default. *- Is there anyway to set an alpha value to the browser with webui? If you want to set a certain alpha value, you have to edit the dxDrawImage call (link: https://github.com/Jusonex/mtasa_cef_to ... w.lua#L155) to: dxDrawImage(self.m_BrowserPos, self.m_BrowserSize, self.m_Browser, 0, 0, 0, tocolor(255, 255, 255, alpha), self.m_PostGUI) By the way: I wrote a small CEF introduction: https://wiki.multitheftauto.com/wiki/CEF_Tutorial (it is still incomplete tho). Link to comment
Recommended Posts