This commit is contained in:
gorhill 2014-09-28 14:58:26 -04:00
parent f0c2285dae
commit e318f5056c
1 changed files with 9 additions and 3 deletions

View File

@ -954,6 +954,8 @@ var startPicker = function() {
urlNormalizer = document.createElement('a');
window.addEventListener('scroll', onScrolled);
document.addEventListener('keydown', onKeyPressed);
highlightElements([], true);
};
/******************************************************************************/
@ -985,9 +987,11 @@ messaging.ask({ what: 'elementPickerArguments' }, function(details) {
// Try using mouse position
if ( details.clientX !== -1 ) {
elem = elementFromPoint(details.clientX, details.clientY);
filtersFromElement(elem);
showDialog();
return;
if ( elem !== null ) {
filtersFromElement(elem);
showDialog();
return;
}
}
// No mouse position available, use suggested target
@ -1027,6 +1031,8 @@ messaging.ask({ what: 'elementPickerArguments' }, function(details) {
}
});
// https://www.youtube.com/watch?v=sociXdKnyr8
/******************************************************************************/
})();