#windows
20 messages · Page 1 of 1 (latest)
<script lang="ts">
import { ipcRenderer} from "electron"
import { useRoute } from "vue-router";
let route = useRoute();
ipcRenderer.on("OutputDemo", async (event, data) => {
console.log(data);
// alert("ประกาศ")
});
import { mapActions } from 'vuex';
export default {
data() {
return {
username: '' as string,
password: '' as string,
}
},
mounted() {
},
methods: {
discord() {
ipcRenderer.send("discord")
},
test() {
ipcRenderer.on('on-msg', (event, data) => {
console.log(data)
})
// ipcRenderer.send('test')
},
}
}
</script>
and what window it is?
this is main process code
so you sending message to closed window?
yes
how it is supposed to read your message then?
res for authWindow
how it is supposed to read your message then?
And I'm sending it back to the other page of the HTML side.
you sending to authWindow.webContents.send('on-msg', token);
OH So I have to send it to win
@molten herald Then how do I wait to receive HTML?
`ipcmain`
authWindow.webContents.on('will-redirect', async (event, newUrl) => {
console.log("xx", newUrl);
const code = newUrl.split("?token=")[1];
const token = await oauth.getUser(code);
console.log(token);
win?.webContents.send('on-msg', token)
// authWindow.close();
});
`html`
ipcRenderer.on('on-msg', (event, data) => {
console.log(data)
})
what html?
How do I wait to receive it?
test() {
ipcRenderer.on('on-msg', (event, data) => {
console.log(data)
})
},
receive where?