From 4d2c8ec7f6d79c400572b9de1aa9110e0cb00c66 Mon Sep 17 00:00:00 2001 From: relrelb Date: Fri, 16 Apr 2021 00:18:39 +0300 Subject: [PATCH] web: Set page title in player.js --- web/packages/extension/src/player.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/web/packages/extension/src/player.js b/web/packages/extension/src/player.js index e793210c3429..0957eff908c2 100644 --- a/web/packages/extension/src/player.js +++ b/web/packages/extension/src/player.js @@ -23,6 +23,13 @@ window.addEventListener("DOMContentLoaded", () => { return; } + try { + const pathname = new URL(swfUrl).pathname; + document.title = pathname.substring(pathname.lastIndexOf("/") + 1); + } catch (_) { + // Ignore URL parsing errors. + } + player = ruffle.createPlayer(); player.id = "player"; document.getElementById("main").append(player);