Skip to content

Commit

Permalink
Desktop: Fix error in plugin content scripts generated with Webpack (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
personalizedrefrigerator authored Jul 4, 2024
1 parent 7e4533d commit c197a83
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/app-desktop/gui/note-viewer/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
<script src="./scrollmap.js"></script>

<script>
// Fixes a warning when loading some TypeScript plugins generated with webpack.
window.exports = {};

// This is function used internally to send message from the webview to
// the host.
const ipcProxySendToHost = (methodName, arg) => {
Expand Down
3 changes: 3 additions & 0 deletions packages/app-desktop/services/plugins/UserWebviewIndex.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
const webviewApiPromises_ = {};
let viewMessageHandler_ = () => {};

// This silences a warning when running plugins generated with Webpack.
window.exports ??= {};

// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
const webviewApi = {
postMessage: function(message) {
Expand Down

0 comments on commit c197a83

Please sign in to comment.