Skip to content

Commit ac422cb

Browse files
committed
Fix #425
1 parent e9932c1 commit ac422cb

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

chrome/content.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,12 +1039,21 @@
10391039
}
10401040

10411041
function testSimilarity(originalElement, childElement, parentElement) {
1042+
const parentStyle = window.getComputedStyle(parentElement);
1043+
// const childStyle = window.getComputedStyle(childElement);
10421044
const parentRect = parentElement.getBoundingClientRect();
1045+
const childRect = childElement.getBoundingClientRect();
1046+
1047+
// Check if child element has fixed position
1048+
if (parentStyle.position === 'fixed') {
1049+
return false;
1050+
}
1051+
1052+
const originalRect = originalElement.getBoundingClientRect();
10431053
if (parentRect.width === 0 || parentRect.height === 0) {
10441054
return true;
10451055
}
10461056

1047-
const originalRect = originalElement.getBoundingClientRect();
10481057
const tolerance = Math.max(Math.min(originalRect.width, originalRect.height, 5000), 100) * 0.1;
10491058
if (
10501059
Math.abs(originalRect.x - parentRect.x) < tolerance &&
@@ -1056,8 +1065,6 @@
10561065
}
10571066

10581067
// Check if parent element is overflow hidden and child element can cover the parent element
1059-
const parentStyle = window.getComputedStyle(parentElement);
1060-
const childRect = childElement.getBoundingClientRect();
10611068
if (parentStyle.overflow === 'hidden') {
10621069
if (childRect.x <= parentRect.x &&
10631070
childRect.y <= parentRect.y &&

chrome/player/VideoSource.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ const headerBlacklist = [
2222
'sec-fetch-storage-access',
2323
'sec-fetch-user',
2424
'upgrade-insecure-requests',
25+
'access-control-request-method',
26+
'access-control-request-headers',
2527
];
2628

2729

0 commit comments

Comments
 (0)