question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

how to open new window

See original GitHub issue

I want to show my chart on the new window , but below code is not work . I need to send data to the new window . how can i do , thanks.

vue is a SAP APP, so i create a new page to do this , whether has another better way?

ipc.on(‘showChart’, function (e, data) { const modalPath = process.env.NODE_ENV === ‘development’ ? http://localhost:9080/showChart.html : file://${__dirname}/showChart.html let win = new BrowserWindow({ width: 400, height: 320, webPreferences: {webSecurity: false} }) win.on(‘close’, function () { win = null }) win.loadURL(modalPath) })

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

48reactions
marceloavfcommented, Sep 19, 2017

First of all, you need to disable mode: 'history' in your vue-router, check in vue-router docs

Then do the following:

src/main/index.js example

ipc.on('showChart', function (e, data) {
  const modalPath = process.env.NODE_ENV === 'development'
    ? 'http://localhost:9080/#/showChart'
    : `file://${__dirname}/index.html#showChart`
  let win = new BrowserWindow({ width: 400, height: 320, webPreferences: {webSecurity: false} })
  win.on('close', function () { win = null })
  win.loadURL(modalPath)
})

In your router, use the exactly path to your url src/renderer/router.js example

{
   path: '/showChart',
   name: 'showChart',
   component: require('your-router'),
 },

If your need another approach, take a look at this repo:

9reactions
randyoucommented, Sep 19, 2017

Your webpack should have multiple entries. multiple entries set plugins

Read more comments on GitHub >

github_iconTop Results From Across the Web

4 Ways to Open a Page in a New Window - wikiHow
1. Right click on the link on your current window. 2. Choose Open in New Window. The page will open in a new...
Read more >
Window open() Method - W3Schools
The open() method opens a new browser window, or a new tab, depending on your browser settings and the parameter values. See Also:...
Read more >
Window.open() - Web APIs | MDN
The open() method of the Window interface loads a specified resource into a new or existing browsing context (that is, a tab, a...
Read more >
How to Open a Second (or Third) Desktop in Windows 10
Follow these steps to open another desktop: Select the Task View button on the taskbar (or press the Windows key plus the Tab...
Read more >
How To Open New Window In JavaScript (Open New Page or ...
javascript #js #tutorialHey guys, Chrome will open a new tab instead of a window by default. I think you can change that in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found