Skream Posted April 6, 2018 Share Posted April 6, 2018 (edited) setBrowserRenderingPaused hidde the browser? How can I destroy the browser? Edited April 6, 2018 by Skream Link to comment
Moderators IIYAMA Posted April 6, 2018 Moderators Share Posted April 6, 2018 (edited) setBrowserRenderingPaused = probably stopping the browser with making cycles. Probably stop doing this: You will need to use guiSetVisible to hide the gui: https://wiki.multitheftauto.com/wiki/GuiSetVisible Yet I recommend you to doing both, because afaik the browser doesn't stops rendering when you hide the gui. (will save you some performance) Edited April 6, 2018 by IIYAMA 1 Link to comment
Skream Posted April 6, 2018 Author Share Posted April 6, 2018 41 minutes ago, IIYAMA said: setBrowserRenderingPaused = probably stopping the browser with making cycles. Probably stop doing this: You will need to use guiSetVisible to hide the gui: https://wiki.multitheftauto.com/wiki/GuiSetVisible Yet I recommend you to doing both, because afaik the browser doesn't stops rendering when you hide the gui. (will save you some performance) I'm doing a CEF chat But I need a clearChat function to anti divulgation propouses do you think this would do the job ? function clearChatBox() loadBrowserURL(cefBrowser, chatUrl) end like a attempt to "reload" the url? Link to comment
Moderators IIYAMA Posted April 6, 2018 Moderators Share Posted April 6, 2018 use JS executeBrowserJavascript ( webBrowser, 'document.getElementById("element-id").innerHTML = ""') https://wiki.multitheftauto.com/wiki/ExecuteBrowserJavascript 1 Link to comment
Skream Posted April 6, 2018 Author Share Posted April 6, 2018 8 minutes ago, IIYAMA said: use JS executeBrowserJavascript ( webBrowser, 'document.getElementById("element-id").innerHTML = ""') https://wiki.multitheftauto.com/wiki/ExecuteBrowserJavascript I think its not that simple because I use insertAdjacentHTML too much. What about function clearChat() { var resetHtml = "<div class='container'>" + "<div id='text-chat' class='chat'></div>" + "<input id='chat-input' type='text' placeholder='Fale por aqui...' spellcheck='false'>" "</div>"; document.body.innerHTML = resetHtml; } do you have any ideia if I would need to call addEventListener again? Because I use focusout check onload window.onload = function() { const chatInput = document.getElementById('chat-input'); chatInput.addEventListener('focusout', function(e) { chatInput.style.animation = 'hide .2s'; chatInput.style.animationFillMode = 'forwards'; mta.triggerEvent('processChat', ''); document.removeEventListener('keydown', enterKeyInputBox, false); }); }; Link to comment
Moderators IIYAMA Posted April 6, 2018 Moderators Share Posted April 6, 2018 (edited) Yes you need to add it again. Better to clear the innerHTML in text-chat instead. Edited April 6, 2018 by IIYAMA 1 Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now