General: Fix page title reset in Chromium (#2580)
This commit is contained in:
parent
22083f9638
commit
39feed7b8d
@ -1,7 +1,14 @@
|
|||||||
|
import { debounce } from './schedulers';
|
||||||
|
|
||||||
|
const UPDATE_DEBOUNCE_MS = 200;
|
||||||
|
|
||||||
// For some reason setting `document.title` to the same value
|
// For some reason setting `document.title` to the same value
|
||||||
// causes increment of Chrome Dev Tools > Performance Monitor > DOM Nodes counter
|
// causes increment of Chrome Dev Tools > Performance Monitor > DOM Nodes counter
|
||||||
export default function updatePageTitle(nextTitle: string) {
|
function updatePageTitle(nextTitle: string) {
|
||||||
if (document.title !== nextTitle) {
|
if (document.title !== nextTitle) {
|
||||||
document.title = nextTitle;
|
document.title = nextTitle;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Synchronous page title update has conflicts with History API in Chrome
|
||||||
|
export default debounce(updatePageTitle, UPDATE_DEBOUNCE_MS, false);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user