<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>大博客服系统</title>
    <% if (htmlWebpackPlugin.options.nodeModules) { %>
      <!-- Add `node_modules/` to global paths so `require` works properly in development -->
      <script>
        require('module').globalPaths.push('<%= htmlWebpackPlugin.options.nodeModules.replace(/\\/g, '\\\\') %>')
      </script>
    <% } %>
  </head>
  <body>
    <div id="app"></div>
    <!-- Set `__static` path to static files in production -->
    <% if (!process.browser) { %>
      <script>
        localStorage.clear();
        sessionStorage.clear();

        const { remote } = require('electron')
        const { Menu, MenuItem } = remote

        const menu = new Menu()
        menu.append(new MenuItem({label:'复制', role: 'copy' }));
        menu.append(new MenuItem({label:'粘贴', role: 'paste' }));
        menu.append(new MenuItem({label:'剪切', role: 'cut' }));
        menu.append(new MenuItem({ label:'全选', role: 'selectall' }));
        window.addEventListener('contextmenu', (e) => {
          e.preventDefault()
          menu.popup({ window: remote.getCurrentWindow() })
        }, false)

        if (process.env.NODE_ENV !== 'development') window.__static = require('path').join(__dirname, '/static').replace(/\\/g, '\\\\')
      </script>
    <% } %>

    <!-- webpack builds are automatically injected -->
  </body>
</html>
