Skip to content

Commit

Permalink
#376 - upload step update for chrome mode (#380)
Browse files Browse the repository at this point in the history
There is likely a change in Chrome Devtools protocol which returns back DOM.attributeModified event messages after DOM.setFileInputFiles method is used in update step.

This causes subsequent steps after upload step not to work. This patch works by filtering and discarding the DOM.attributeModified event messages so that subsequent communication messages with Chrome will continue to work.
  • Loading branch information
kensoh authored Apr 4, 2019
1 parent af4559c commit 686218b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/tagui_chrome.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@
else if (strpos($tagui_intent,'Target.detachFromTarget') !== false) $intent_result_string = trim($client->receive());

// ignore irrelevant DOM.setChildNodes events received when using DOM.querySelector to get NodeId for upload step
while (strpos($intent_result_string,"DOM.setChildNodes") !== false) {$intent_result_string = trim($client->receive());}
// and ignore irrelevant DOM.attributeModified events received after using DOM.setFileInputFiles in upload step
while ((strpos($intent_result_string,"DOM.setChildNodes") !== false) or
(strpos($intent_result_string,"DOM.attributeModified") !== false))
{$intent_result_string = trim($client->receive());}

// save intent_result to interface out-file
echo "[tagui] OUTPUT - \n" . "[" . $tagui_count . "] " . $intent_result_string . "\n\n";
Expand Down

0 comments on commit 686218b

Please sign in to comment.