Allow the Recorder to record "canvas" actions

This commit is contained in:
Michael Mintz 2022-03-02 14:53:45 -05:00
parent 164878c84f
commit 8e27216df6
2 changed files with 11 additions and 1 deletions

Binary file not shown.

View File

@ -198,6 +198,7 @@ var getBestSelector = function(el) {
basic_tags.push('h1');
basic_tags.push('h2');
basic_tags.push('h3');
basic_tags.push('canvas');
basic_tags.push('center');
basic_tags.push('input');
basic_tags.push('textarea');
@ -625,7 +626,7 @@ document.body.addEventListener('mouseup', function (event) {
}
else
document.recorded_actions.push(['click', selector, href, d_now]);
// hover_click() if dropdown.
// hover_click()
if (el.parentElement.classList.contains('dropdown-content') &&
el.parentElement.parentElement.classList.contains('dropdown'))
{
@ -641,6 +642,15 @@ document.body.addEventListener('mouseup', function (event) {
document.recorded_actions.pop();
document.recorded_actions.push(['h_clk', pa_s, ch_s, d_now]);
}
else if (tag_name === 'canvas')
{
rect = el.getBoundingClientRect();
p_x = event.clientX - rect.left;
p_y = event.clientY - rect.top;
c_offset = [selector, p_x, p_y];
document.recorded_actions.pop();
document.recorded_actions.push(['canva', c_offset, href, d_now]);
}
}
else if (ra_len > 0 &&
document.recorded_actions[ra_len-1][0] === 'mo_dn' &&