mirror of
https://github.com/gorhill/uBlock.git
synced 2024-09-03 01:29:39 +02:00
Save mouse position only in top document
... for the element picker. This way, right click/block element in an iframe won't select the wrong element in the top document. Instead, it will allow the user to pick the element manually.
This commit is contained in:
parent
9669793066
commit
7dd60738c1
@ -127,7 +127,7 @@ var messager = vAPI.messaging.channel('contentscript-end.js');
|
|||||||
};
|
};
|
||||||
|
|
||||||
// https://github.com/gorhill/uBlock/issues/452
|
// https://github.com/gorhill/uBlock/issues/452
|
||||||
// This needs to be executed *after* the response from our query is
|
// This needs to be executed *after* the response from our query is
|
||||||
// received, not at `DOMContentLoaded` time, or else there is a good
|
// received, not at `DOMContentLoaded` time, or else there is a good
|
||||||
// likeliness to outrun contentscript-start.js, which may still be waiting
|
// likeliness to outrun contentscript-start.js, which may still be waiting
|
||||||
// on a response from its own query.
|
// on a response from its own query.
|
||||||
@ -749,6 +749,9 @@ var messager = vAPI.messaging.channel('contentscript-end.js');
|
|||||||
// Ref.: https://developer.mozilla.org/en-US/docs/Web/Events/contextmenu
|
// Ref.: https://developer.mozilla.org/en-US/docs/Web/Events/contextmenu
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
if ( window !== window.top ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
var onContextMenu = function(ev) {
|
var onContextMenu = function(ev) {
|
||||||
messager.send({
|
messager.send({
|
||||||
what: 'contextMenuEvent',
|
what: 'contextMenuEvent',
|
||||||
|
Loading…
Reference in New Issue
Block a user