mirror of
https://github.com/vale981/tridactyl
synced 2025-03-05 17:41:40 -05:00
Fix #4469: wrap history events in try/catch
This commit is contained in:
parent
923e5e9411
commit
78d0fa91df
1 changed files with 33 additions and 27 deletions
|
@ -41,6 +41,8 @@ config.getAsync("superignore").then(async TRI_DISABLE => {
|
|||
|
||||
if (TRI_DISABLE === "true") return
|
||||
|
||||
try {
|
||||
|
||||
// Add cheap location change event
|
||||
// Adapted from: https://stackoverflow.com/questions/6390341/how-to-detect-if-url-has-changed-after-hash-in-javascript
|
||||
//
|
||||
|
@ -76,6 +78,10 @@ history.pushState = triPushState
|
|||
typeof(exportFunction) == "function" && exportFunction(triReplaceState, history, {defineAs: "replaceState"})
|
||||
typeof(exportFunction) == "function" && exportFunction(triPushState, history, {defineAs: "pushState"})
|
||||
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
}
|
||||
|
||||
const controller = await import("@src/lib/controller")
|
||||
const excmds_content = await import("@src/.excmds_content.generated")
|
||||
const hinting_content = await import("@src/content/hinting")
|
||||
|
|
Loading…
Add table
Reference in a new issue