Quantcast
Channel: ClearScript
Viewing all articles
Browse latest Browse all 2297

New Post: Possible to get string content of passed in function?

$
0
0
We are building a bridge between CEF and C#. The C# console app is driven by javascript code. Used to basically drive a headless browser. So far clerscript has been a great tool. I was wondering if it is possible to pull the string content of a passed in JavaScript function...so I can then inject that back into the headless browser.

For example in my C# class I would have this code
    public void execute(dynamic function)
    {
        //Parse function into string and inject back into CEF Browser frame
    }
And the script driving all this looks like this
...
...
    page.open(address, function(status) { 

      if(status != "success")
      {
        console.log("Load failed");
        chromejs.exit(2);
      }

      // TRYING TO MAKE THIS PART WORK
      page.execute(function() {
        return document.title;
      });

      page.render("test.png");
      chromejs.exit();  
    });

Viewing all articles
Browse latest Browse all 2297

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>