v0.2.1 (#53)
* ios proxy app, tune vp8 tunnel * refactor go modules, move headless joiner android to a go captcha * restore emojis in vk bot keyboard * headless support in vk bot * remove telemost dc hooks, update cretor-app ui and bot * remove telemost support from go code, add fallback to video if mode == dc in joiners * fix headless creators in windows * update vk call creation autoclick * force desktop useragent for creator app * kick disconnected user in headless vk creator immediately when connection is lost * update README.md * update SETUP.md * update release version * add fallback for link creation in vk bot
This commit is contained in:
1 parent
9e1f2a98d9
commit
1b2d6bc5d3
89 files changed
+3503
-2158
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import { Platform, Bridge, LogPanel, Webview } from '../types';
|
||||
import { Platform, Bridge, LogPanel, TunnelMode, Webview } from '../types';
|
||||
import { SESSION_PARTITION, HOOK_POLL_INTERVAL_MS, CALL_CREATOR_INJECT_DELAY_MS } from '../constants';
|
||||
import { RendererTabManager } from './tab-manager';
|
||||
|
||||
@@ -71,7 +71,12 @@ export function renderContent(tm: RendererTabManager): void {
|
||||
} else {
|
||||
toolbar.style.display = 'flex';
|
||||
headlessInfo.style.display = 'none';
|
||||
(document.getElementById('modeSelect') as HTMLSelectElement).value = activeTab.mode;
|
||||
const isVK = activeTab.platform === Platform.VK && activeTab.url.includes('vk.com');
|
||||
const modeSelect = document.getElementById('modeSelect') as HTMLSelectElement;
|
||||
const tunnelLabel = document.getElementById('tunnelLabel') as HTMLElement;
|
||||
modeSelect.style.display = isVK ? '' : 'none';
|
||||
tunnelLabel.style.display = isVK ? '' : 'none';
|
||||
modeSelect.value = activeTab.mode;
|
||||
if (activeTab.wv) activeTab.wv.classList.remove('hidden');
|
||||
}
|
||||
|
||||
@@ -98,6 +103,13 @@ export function scrollLogs(): void {
|
||||
export function loadURL(tm: RendererTabManager, url: string): void {
|
||||
if (!tm.activeTabId) return;
|
||||
const activeTab = tm.tabs[tm.activeTabId];
|
||||
if (url.includes('telemost.yandex')) {
|
||||
activeTab.platform = Platform.Telemost;
|
||||
activeTab.mode = TunnelMode.PionVideo;
|
||||
} else if (url.includes('vk.com')) {
|
||||
activeTab.platform = Platform.VK;
|
||||
}
|
||||
window.bridge.setTunnelMode(tm.activeTabId, activeTab.mode, activeTab.platform);
|
||||
if (activeTab.wv) activeTab.wv.remove();
|
||||
|
||||
const webview = document.createElement('webview') as unknown as Webview;
|
||||
@@ -105,6 +117,7 @@ export function loadURL(tm: RendererTabManager, url: string): void {
|
||||
webview.setAttribute('partition', SESSION_PARTITION);
|
||||
webview.setAttribute('nodeintegration', '');
|
||||
webview.setAttribute('nodeintegrationinsubframes', '');
|
||||
webview.setAttribute('useragent', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36');
|
||||
webview.classList.add('webview-full');
|
||||
webview.dataset.tabId = tm.activeTabId;
|
||||
document.getElementById('content')!.appendChild(webview);
|
||||
@@ -150,6 +163,7 @@ export function loadURL(tm: RendererTabManager, url: string): void {
|
||||
activeTab.wv = webview;
|
||||
activeTab.url = url;
|
||||
renderTabs(tm);
|
||||
renderContent(tm);
|
||||
}
|
||||
|
||||
export function startHookLogPoller(tm: RendererTabManager): void {
|
||||
|
||||
@@ -155,9 +155,14 @@ function init(): void {
|
||||
window.bridge.onCreateBotTab((data: BotTabData) => {
|
||||
tm.createBotTab(data);
|
||||
(document.getElementById('modeSelect') as HTMLSelectElement).value = data.mode;
|
||||
window.bridge.setTunnelMode(data.tabId, data.mode);
|
||||
const url = data.platform === Platform.Telemost ? TELEMOST_URL : VK_IM_URL;
|
||||
loadURL(tm, url);
|
||||
if (data.mode === TunnelMode.HeadlessVK) {
|
||||
tm.switchToHeadless(Platform.VK);
|
||||
} else if (data.mode === TunnelMode.HeadlessTelemost) {
|
||||
tm.switchToHeadless(Platform.Telemost);
|
||||
} else {
|
||||
const url = data.platform === Platform.Telemost ? TELEMOST_URL : VK_IM_URL;
|
||||
loadURL(tm, url);
|
||||
}
|
||||
});
|
||||
|
||||
window.bridge.onCloseBotTab((data: { tabId: string }) => {
|
||||
|
||||
@@ -30,7 +30,6 @@ export class RendererTabManager {
|
||||
name: '',
|
||||
isBot: false,
|
||||
};
|
||||
window.bridge.startRelay(tabId);
|
||||
this.selectTab(tabId);
|
||||
return tabId;
|
||||
}
|
||||
@@ -57,7 +56,9 @@ export class RendererTabManager {
|
||||
|
||||
createBotTab(data: BotTabData): void {
|
||||
if (!this.tabs[data.tabId]) {
|
||||
const botName = data.platform === Platform.Telemost ? 'Bot-Telemost' : 'Bot-VK';
|
||||
const isHeadless = data.mode === TunnelMode.HeadlessVK || data.mode === TunnelMode.HeadlessTelemost;
|
||||
const platformLabel = data.platform === Platform.Telemost ? 'TM' : 'VK';
|
||||
const botName = isHeadless ? `Bot-Headless-${platformLabel}` : `Bot-${data.platform === Platform.Telemost ? 'Telemost' : 'VK'}`;
|
||||
this.tabs[data.tabId] = {
|
||||
wv: null,
|
||||
url: '',
|
||||
@@ -141,23 +142,22 @@ export class RendererTabManager {
|
||||
tab.headlessStatus = 'Call created';
|
||||
changed = true;
|
||||
}
|
||||
if (trimmed.includes(HeadlessLogMarker.JOIN_LINK)) {
|
||||
if (!tab.callInfo) tab.callInfo = {};
|
||||
if (trimmed.includes(HeadlessLogMarker.JOIN_LINK) && tab.callInfo) {
|
||||
tab.callInfo.joinLink = trimmed.split(HeadlessLogMarker.JOIN_LINK)[1].trim();
|
||||
if (tab.isBot) {
|
||||
window.bridge.sendBotCallLink(tabId, tab.callInfo.joinLink);
|
||||
}
|
||||
changed = true;
|
||||
}
|
||||
if (trimmed.includes(HeadlessLogMarker.SHORT_LINK)) {
|
||||
if (!tab.callInfo) tab.callInfo = {};
|
||||
if (trimmed.includes(HeadlessLogMarker.SHORT_LINK) && tab.callInfo) {
|
||||
tab.callInfo.shortLink = trimmed.split(HeadlessLogMarker.SHORT_LINK)[1].trim();
|
||||
changed = true;
|
||||
}
|
||||
if (trimmed.includes(HeadlessLogMarker.TURN)) {
|
||||
if (!tab.callInfo) tab.callInfo = {};
|
||||
if (trimmed.includes(HeadlessLogMarker.TURN) && tab.callInfo) {
|
||||
tab.callInfo.turn = trimmed.split(HeadlessLogMarker.TURN)[1].trim();
|
||||
changed = true;
|
||||
}
|
||||
if (trimmed.includes(HeadlessLogMarker.PROTOCOL)) {
|
||||
if (!tab.callInfo) tab.callInfo = {};
|
||||
if (trimmed.includes(HeadlessLogMarker.PROTOCOL) && tab.callInfo) {
|
||||
tab.callInfo.protocol = trimmed.split(HeadlessLogMarker.PROTOCOL)[1].trim();
|
||||
changed = true;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user