[mv3] Fix zapper

Regression from:
b5651417aa
This commit is contained in:
Raymond Hill 2025-04-21 08:11:22 -04:00
parent 34d6abca6d
commit 22e848c9c2
No known key found for this signature in database
GPG key ID: 25E1490B761470C2

View file

@ -371,7 +371,7 @@ const bootstrap = async ( ) => {
return new Promise(resolve => {
const frame = document.createElement('iframe');
frame.setAttribute(zapperSecret, '');
frame.onload = ( ) => {
const onZapperLoad = ( ) => {
frame.onload = null;
frame.setAttribute(`${zapperSecret}-loaded`, '');
const channel = new MessageChannel();
@ -395,13 +395,11 @@ const bootstrap = async ( ) => {
zapperFramePort: port,
});
};
if ( dynamicURL.protocol !== 'safari-web-extension:' ) {
document.documentElement.append(frame);
frame.onload = ( ) => {
frame.onload = onZapperLoad;
frame.contentWindow.location = dynamicURL.href;
} else {
frame.setAttribute('src', dynamicURL.href);
document.documentElement.append(frame);
}
};
document.documentElement.append(frame);
});
};