Skip to content

Commit

Permalink
web: Set page title in player.js
Browse files Browse the repository at this point in the history
  • Loading branch information
relrelb authored and Herschel committed Apr 15, 2021
1 parent 9021da8 commit 4d2c8ec
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions web/packages/extension/src/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 4d2c8ec

Please sign in to comment.