Set a breakpoint in the TChromium.OnBeforePopup event to check if it's triggered. If not, delete it and add it again by double clicking in the "Object Inspector" in Delphi.lifeform wrote: Sun Oct 21, 2018 7:54 am hello
my login page is used frame, i can login but when button login clicked it always open new windows and always open like that...
my code is like this
noFrame := message.ArgumentList.GetInt(1);
chrome.Browser.GetFrameByident(noFrame).ExecuteJavaScript('document.evaluate("' + input_email + '", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.value = ' + QuotedStr(username) + ';', 'about:blank', 0);
Application.ProcessMessages;
Sleep(250);
Application.ProcessMessages;
chrome1.Browser.GetFrameByident(noFrame).ExecuteJavaScript('document.evaluate("' + input_password + '", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.value = ' + QuotedStr(password) + ';', 'about:blank', 0);
Application.ProcessMessages;
Sleep(250);
Application.ProcessMessages;
chrome1.Browser.GetFrameByident(noFrame).ExecuteJavaScript('document.evaluate("' + button_login_inframe + '", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.click();', 'about:blank', 0);
where noFrame is identification of the frame where login form located.
is there something wrong with my code?
i also have prevent popup with event before popup
Some old CEF4Delphi versions had slightly different TChromium.OnBeforePopup event parameters and this could break that event.
I would advise against using "Application.ProcessMessages". Read this for more information about it :
https://stackoverflow.com/questions/251 ... i-is-doing
https://www.thoughtco.com/dark-side-of- ... es-1058203