Skip to content

Commit

Permalink
fix: do not set allFrames and frameIds at the same time
Browse files Browse the repository at this point in the history
  • Loading branch information
dessant committed Sep 27, 2024
1 parent ccb7b94 commit 919f504
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/utils/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@ function insertCSS({
origin = 'USER'
}) {
if (mv3) {
const params = {target: {tabId, allFrames}};
const params = {target: {tabId}};

if (!allFrames) {
// Safari 17: allFrames and frameIds cannot both be specified,
// fixed in Safari 18.
if (allFrames) {
params.target.allFrames = true;
} else {
params.target.frameIds = frameIds;
}

Expand Down Expand Up @@ -61,9 +65,13 @@ async function executeScript({
code = ''
}) {
if (mv3) {
const params = {target: {tabId, allFrames}, world};
const params = {target: {tabId}, world};

if (!allFrames) {
// Safari 17: allFrames and frameIds cannot both be specified,
// fixed in Safari 18.
if (allFrames) {
params.target.allFrames = true;
} else {
params.target.frameIds = frameIds;
}

Expand Down

0 comments on commit 919f504

Please sign in to comment.