Skip to content

Commit

Permalink
fix: プリロードスクリプトを変更した時HMR(自動リロード)が機能しない問題を修正 (#2157)
Browse files Browse the repository at this point in the history
* fix: プリロードスクリプトを変更した時HMR(自動リロード)が機能しない問題を修正

* Apply suggestions from code review

---------

Co-authored-by: Hiroshiba <[email protected]>
  • Loading branch information
sabonerune and Hiroshiba authored Jul 6, 2024
1 parent a8cd541 commit 8a4cdd2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/backend/electron/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1029,8 +1029,11 @@ app.on("web-contents-created", (e, contents) => {

// ナビゲーションを無効化
contents.on("will-navigate", (event) => {
log.error(`ナビゲーションは無効化されています。url: ${event.url}`);
event.preventDefault();
// preloadスクリプト変更時のホットリロードを許容する
if (contents.getURL() !== event.url) {
log.error(`ナビゲーションは無効化されています。url: ${event.url}`);
event.preventDefault();
}
});
});

Expand Down

0 comments on commit 8a4cdd2

Please sign in to comment.