set_document_complete_java_script
set_document_complete_java_script($script_text,$add_file); - add to the current page and call any JS immediately after the page document (and each page frame) is formed. This code will be executed in each frame and on the page. This can be useful for changing page objects, such as navigator.appName. (available from version 4.9.34)
The function accepts parameters as input:
$script_text – script text. If you need to get the result of the script, it is transmitted by creating additional DOM objects on the page.$add_file – path to the file whose contents will be added to the beginning of the script text (if empty or there is no file, it will not affect anything).
After testing, the function returns the result of its work to the script :
true – completed successfully
false – failed