Initial MV3
commit
03ac203786
|
@ -0,0 +1,28 @@
|
|||
async function getCurrentTab() {
|
||||
let queryOptions = { active: true, currentWindow: true };
|
||||
let [tab] = await chrome.tabs.query(queryOptions);
|
||||
return tab;
|
||||
}
|
||||
|
||||
chrome.runtime.onInstalled.addListener(() => {
|
||||
chrome.contextMenus.create({
|
||||
title: 'Make Gather fullscreen',
|
||||
type: 'normal',
|
||||
documentUrlPatterns: ["https://gather.town/app/*"],
|
||||
id: 'make-fullscreen',
|
||||
});
|
||||
});
|
||||
|
||||
chrome.contextMenus.onClicked.addListener(async (data) => {
|
||||
if (data.menuItemId === 'make-fullscreen') {
|
||||
const tab = await getCurrentTab();
|
||||
await chrome.scripting.insertCSS({
|
||||
target: { tabId: tab.id },
|
||||
files: ['inject.css'],
|
||||
});
|
||||
await chrome.scripting.executeScript({
|
||||
target: { tabId: tab.id },
|
||||
files: ['inject.js'],
|
||||
});
|
||||
}
|
||||
});
|
|
@ -0,0 +1,5 @@
|
|||
window.innerWidth = 1920 + 72;
|
||||
window.innerHeight = 1080;
|
||||
|
||||
document.body.style.transform = 'translate(-72px, 0)';
|
||||
document.body.style.width = `${1920 + 72}px`;
|
|
@ -0,0 +1,12 @@
|
|||
body {
|
||||
transform: translate(-72px, 0);
|
||||
width: calc(100vw + 72px);
|
||||
}
|
||||
|
||||
/* Additional */
|
||||
.GameCanvasContainer-settings {
|
||||
display: none;
|
||||
}
|
||||
.GameVideo-self-video-container {
|
||||
display: none;
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
const script = document.createElement('script');
|
||||
script.innerHTML = `
|
||||
window.innerWidth = window.outerWidth + 72;
|
||||
window.innerHeight = window.outerHeight;
|
||||
`;
|
||||
document.head.appendChild(script);
|
||||
|
||||
//document.body.style.transform = 'translate(-72px, 0)';
|
||||
//document.body.style.width = `${window.outerWidth + 72}px`;
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"name": "Gather Fullscreen",
|
||||
"description": "Click to show Gather in fullscreen",
|
||||
"version": "1.0",
|
||||
"permissions": ["contextMenus", "scripting"],
|
||||
"host_permissions": ["https://gather.town/app/*"],
|
||||
"background": {
|
||||
"type": "module",
|
||||
"service_worker": "background.js"
|
||||
},
|
||||
"manifest_version": 3
|
||||
}
|
Loading…
Reference in New Issue