No announcement yet.

What happens in the OnBeforePopup function?

  • Filter
  • Time
  • Show
Clear All
new posts

  • What happens in the OnBeforePopup function?

    Someone from github has asked me a question. And the answer is the following.
    This answer will show you how difficult it is to design a program.
    Because of poor design, programmers suffer seriously.
    It's a pain if you don't get the pointer you need as a function's parameter at the moment
    you absolutely need it.
    Especially when this happens in an asynchronous function, the pain doubles or triples.
    So if you can design a nice API that's easy for programmers to use, that's god.
    However, most designers prefer singleton designs because they are not as good as
    programmers in enterprise companies. Trying a better design may have a lesser effect
    than a singleton. I think it's better to have a singleton that puts all the information into
    one class. It's a dirty design, but at least it doesn't hurt everyone.
    It is a wise saying of the day. Remember A good design is sometimes even a dirty design.
    To avoid the same problem now, you need to modify the source code yourself.
    Become a hacker!

    when the page have form and the action is other page , it will not working properly:

    <form id="form1" target="_blank" action="web2.aspx" method="post">
    <input type="text" id="input1" name="input1" />
    <input type="text" id="input2" name="input2" />
    <input type="button" onclick="fun_post();" value="posttest" />
    <script type="text/javascript">
    function fun_post()


    then the web2.aspx can not get the post data !!

    public partial class web2 : System.Web.UI.Page
    protected void Page_Load(object sender, EventArgs e)
    string TemName = "", TemValue = "";
    int temlen = this.Page.Request.Form.Count;
    if (temlen <= 0) { return; }
    int i = 0;
    TemValue = this.Page.Request.Form;
    TemName = this.Page.Request.Form.Keys;
    this.Page.Response.Write(TemName + ":" + TemValue + "<br>");

    I am currently modifying the files in the libcef project.
    Because, I am modifying to make OnBeforePopup to pass the ICefRequest pointer.
    And this ICefRequest parameter must exist as a parameter of OnBeforePopup function
    to extract PostData. I'm currently blocking all the process of opening a new window
    inside the OnBeforePopup function. And I'm creating a custom window inside the
    OnBeforePopup function. However, when I create a new window, I can't send the FORM
    data to the new window because I simply create a browser with just the text URL
    information. Therefore, this problem must be solved. Currently when I prevent a new
    window from opening in the OnBeforePopup function, the OnBeforeBrowse function
    is not called. Unfortunately, the OnBeforeBrowse function has an ICefRequest
    parameter. Even worse, there is no way to prevent a new window from opening when the
    OnBeforeBrowse function is executed. This is a very chronic problem for all libcef
    teams. So I am modifying the OnBeforePopup function to extract the ICefRequest
    parameter. If ICefRequest is passed as a parameter of OnBeforePopup function, you can
    pass POST request data to custom window as "(TChromium * chrome)-> LoadRequest (request)"
    while creating a new window. I hope this works.!to...ue/XhunSAvu1zY

  • #2
    I'm looking for someone who can modify the source code to pass request parameters to OnBeforePopup in libcef.
    Due to the annual project, I did not mention NinjaBrowser improvements.
    And when the project was over, I couldn't touch NinjaBrowser project to create a CVE technical document.
    Now let's work again.
    I don't know if it's possible that I mentioned now.
    From my research, the rendering UI thread and the Logic thread seemed to work in separate queues.
    It was not a structure that was possible with simple modifications.