mirror of
https://github.com/dgtlmoon/changedetection.io.git
synced 2025-12-12 19:16:40 +00:00
BrowserSteps - Remove unreliable method for detecting if the element has a "click" listener and default to click (switch to 'Click X,Y' will return the right co-ords anyway)
This commit is contained in:
@@ -214,11 +214,18 @@ $(document).ready(function () {
|
|||||||
$('input[placeholder="Value"]', first_available).addClass('ok').click().focus();
|
$('input[placeholder="Value"]', first_available).addClass('ok').click().focus();
|
||||||
found_something = true;
|
found_something = true;
|
||||||
} else {
|
} else {
|
||||||
if (x['isClickable'] || x['tagName'].startsWith('h') || x['tagName'] === 'a' || x['tagName'] === 'button' || x['tagtype'] === 'submit' || x['tagtype'] === 'checkbox' || x['tagtype'] === 'radio' || x['tagtype'] === 'li') {
|
// There's no good way (that I know) to find if this
|
||||||
|
// see https://stackoverflow.com/questions/446892/how-to-find-event-listeners-on-a-dom-node-in-javascript-or-in-debugging
|
||||||
|
// https://codepen.io/azaslavsky/pen/DEJVWv
|
||||||
|
|
||||||
|
// So we dont know if its really a clickable element or not :-(
|
||||||
|
// Assume it is - then we dont fill the pages with unreliable "Click X,Y" selections
|
||||||
|
// If you switch to "Click X,y" after an element here is setup, it will give the last co-ords anyway
|
||||||
|
//if (x['isClickable'] || x['tagName'].startsWith('h') || x['tagName'] === 'a' || x['tagName'] === 'button' || x['tagtype'] === 'submit' || x['tagtype'] === 'checkbox' || x['tagtype'] === 'radio' || x['tagtype'] === 'li') {
|
||||||
$('select', first_available).val('Click element').change();
|
$('select', first_available).val('Click element').change();
|
||||||
$('input[type=text]', first_available).first().val(x['xpath']);
|
$('input[type=text]', first_available).first().val(x['xpath']);
|
||||||
found_something = true;
|
found_something = true;
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
first_available.xpath_data_index = xpath_data_index;
|
first_available.xpath_data_index = xpath_data_index;
|
||||||
|
|||||||
Reference in New Issue
Block a user