Skip to content

Commit

Permalink
fix firefox iframe player not working
Browse files Browse the repository at this point in the history
  • Loading branch information
xmcp committed Apr 7, 2024
1 parent afdaf25 commit e538862
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function firefox_manifest(src, path) {
// https://bugzilla.mozilla.org/show_bug.cgi?id=1736575
for(let s of obj.content_scripts)
if(s.world==='MAIN') {
s.js = []; // will be injected by content_script.js
s.js = ['/assets/xhr_hook_injector.js'];
delete s.world;
}

Expand Down
6 changes: 6 additions & 0 deletions pakkujs/assets/xhr_hook_injector.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// used for firefox

console.log('pakku: inject xhr hook');
let sc = document.createElement('script');
sc.src = chrome.runtime.getURL('/assets/xhr_hook.js');
document.documentElement.appendChild(sc);
9 changes: 1 addition & 8 deletions pakkujs/core/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,4 @@ window.addEventListener('message',async function(event) {

handle_task(url[0], url[1], sendResponse, local_config, tabid as int);
}
},false);

if(process.env.PAKKU_CHANNEL === 'firefox') {
console.log('pakku: inject xhr hook');
let sc = document.createElement('script');
sc.src = chrome.runtime.getURL('/assets/xhr_hook.js');
document.documentElement.appendChild(sc);
}
},false);
2 changes: 1 addition & 1 deletion pakkujs/core/post_combine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ export function post_combine(input: DanmuClusterOutput, prev_input: DanmuCluster
}
}

// it seems that hot colorful danmus have style may issues, so we remove the colorful if hot
// it seems that hot colorful danmus may have style issues, so we remove the colorful if hot
if(dm.extra.proto_attr && (dm.extra.proto_attr & 4)) {
dm.extra.proto_colorful = 0;
}
Expand Down

0 comments on commit e538862

Please sign in to comment.