mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-24 11:22:44 +01:00
this fixes #210
This commit is contained in:
parent
75c24a4368
commit
67495378cf
@ -280,8 +280,11 @@ var highlightElements = function(elems, force) {
|
||||
}
|
||||
}
|
||||
targetElements = elems;
|
||||
var offx = window.pageXOffset;
|
||||
var offy = window.pageYOffset;
|
||||
|
||||
// https://github.com/gorhill/uBlock/issues/210
|
||||
var bodyRect = document.body.getBoundingClientRect();
|
||||
var offx = bodyRect.left;
|
||||
var offy = bodyRect.top;
|
||||
var ow = svgRoot.getAttribute('width');
|
||||
var ocean = [
|
||||
'M0 0',
|
||||
@ -299,14 +302,14 @@ var highlightElements = function(elems, force) {
|
||||
}
|
||||
r = elem.getBoundingClientRect();
|
||||
ocean.push(
|
||||
'M', r.left + offx, ' ', r.top + offy,
|
||||
'M', r.left - offx, ' ', r.top - offy,
|
||||
'h', r.width,
|
||||
'v', r.height,
|
||||
'h-', r.width,
|
||||
'z'
|
||||
);
|
||||
islands.push(
|
||||
'M', r.left + offx, ' ', r.top + offy,
|
||||
'M', r.left - offx, ' ', r.top - offy,
|
||||
'h', r.width,
|
||||
'v', r.height,
|
||||
'h-', r.width,
|
||||
|
Loading…
Reference in New Issue
Block a user