Skip to content

Commit 8e27216

Browse files
committed
Allow the Recorder to record "canvas" actions
1 parent 164878c commit 8e27216

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

seleniumbase/extensions/recorder.zip

90 Bytes
Binary file not shown.

seleniumbase/js_code/recorder_js.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@
198198
basic_tags.push('h1');
199199
basic_tags.push('h2');
200200
basic_tags.push('h3');
201+
basic_tags.push('canvas');
201202
basic_tags.push('center');
202203
basic_tags.push('input');
203204
basic_tags.push('textarea');
@@ -625,7 +626,7 @@
625626
}
626627
else
627628
document.recorded_actions.push(['click', selector, href, d_now]);
628-
// hover_click() if dropdown.
629+
// hover_click()
629630
if (el.parentElement.classList.contains('dropdown-content') &&
630631
el.parentElement.parentElement.classList.contains('dropdown'))
631632
{
@@ -641,6 +642,15 @@
641642
document.recorded_actions.pop();
642643
document.recorded_actions.push(['h_clk', pa_s, ch_s, d_now]);
643644
}
645+
else if (tag_name === 'canvas')
646+
{
647+
rect = el.getBoundingClientRect();
648+
p_x = event.clientX - rect.left;
649+
p_y = event.clientY - rect.top;
650+
c_offset = [selector, p_x, p_y];
651+
document.recorded_actions.pop();
652+
document.recorded_actions.push(['canva', c_offset, href, d_now]);
653+
}
644654
}
645655
else if (ra_len > 0 &&
646656
document.recorded_actions[ra_len-1][0] === 'mo_dn' &&

0 commit comments

Comments
 (0)