electron

download attribute not suggesting file extension in save dialog

本秂侑毒 提交于 2021-01-28 05:04:58
问题 I am using a download link and in electron, the link opens but the Save as type only shows All Files (*.*) Is there a way for electron to force a file extension in that field using just an <a> tag? This works in chrome where it shows MY_EXTENSION (*.my_extension) , but in electron it does not. This is useful for if you rename the file without the extension in the new name, it will automatically add it when downloaded. Here is what the link looks like: <a href="/path/to/file.my_extension"

download attribute not suggesting file extension in save dialog

不打扰是莪最后的温柔 提交于 2021-01-28 04:21:27
问题 I am using a download link and in electron, the link opens but the Save as type only shows All Files (*.*) Is there a way for electron to force a file extension in that field using just an <a> tag? This works in chrome where it shows MY_EXTENSION (*.my_extension) , but in electron it does not. This is useful for if you rename the file without the extension in the new name, it will automatically add it when downloaded. Here is what the link looks like: <a href="/path/to/file.my_extension"

Failed at the electron@1.8.2 postinstall script

喜你入骨 提交于 2021-01-28 03:01:51
问题 I was trying to install electron into my project, but it is giving an error. I also tried to do this with unsafe-perm, but still giving the same error. npm install electron --save-dev --save-exact > electron@1.8.2 postinstall E:\PrgLang\Electron\crypto-app\node_modules\electron > node install.js Downloading electron-v1.8.2-win32-x64.zip [============================================>] 100.0% of 55.21 MB (1.51 MB/s) E:\PrgLang\Electron\crypto-app\node_modules\electron\install.js:47 throw err ^

Electron loading html inside pre tag

送分小仙女□ 提交于 2021-01-28 02:51:50
问题 I recently created an electron/angular app which runs the following inside main.ts : win.loadURL(url.format({ pathname: path.join(__dirname, 'dist/index.html'), protocol: 'file:', slashes: true })); When the electron app loads, the following shows Somehow, the html is loading inside a <pre> tag inside html. I have checked __dirname/dist and the folder contains all the correct files (i.e. index.html, main.js, etc). Has anyone seen something similar with electron before? If so, any clues as to

Electronjs and Nodejs(Crypto) crypto.scryptSync is not a function

穿精又带淫゛_ 提交于 2021-01-28 02:34:23
问题 Hi So I have a server running Crypto it working perfectly. Im using electronjs as a client side and crypto is suppose to be build into node. when I try use the module it returns "crypto.scryptSync is not a function" I have let crypto = require('crypto'); at the top of the page im just doing a simple call like this Encrypt_AES function Encrypt_AES(data, pubkey) { const algorithm = 'aes-192-cbc'; const key = crypto.scryptSync(pubkey, 'salt', 24); const iv = Buffer.alloc(16, 0); //

Electron loading html inside pre tag

元气小坏坏 提交于 2021-01-27 23:58:38
问题 I recently created an electron/angular app which runs the following inside main.ts : win.loadURL(url.format({ pathname: path.join(__dirname, 'dist/index.html'), protocol: 'file:', slashes: true })); When the electron app loads, the following shows Somehow, the html is loading inside a <pre> tag inside html. I have checked __dirname/dist and the folder contains all the correct files (i.e. index.html, main.js, etc). Has anyone seen something similar with electron before? If so, any clues as to

Uml / sequence / package / … diagram alternative for JavaScript and Electron application?

久未见 提交于 2021-01-27 23:45:22
问题 My question is if there are any kind of diagram I could draw in order to visualise and Electron / JavaScript application? I would need alternative for the different uml diagrams, like class or package diagram but since JS is prototype-based and it's not like Java or C# I don't know what I could do. The only one I might be able to make is a sequence diagram, but I should (probably must) make other diagrams as well. 回答1: First of all, you're not obliged to document everything in UML diagrams at

`document` is not defined Electron

北城以北 提交于 2021-01-27 18:25:20
问题 I'm trying to read JSON from a file using the fs module, and display that in a div with id list in an Electron app. My code in index.js looks like this: dialog.showOpenDialog((filenames) => { if (!filenames) return; fs.readFile(filenames[0], (err, data) => { if (err) { alert('Could not read file.\n\nDetails:\n' + err.message); return; } let json = JSON.parse(data).en; for (let i = 0; i < json.length; ++i) { let html = "<div class='entry'><b>"; // Add more to html variable from json data $(

How can I get a window object from new BrowserWindow() in electron?

拥有回忆 提交于 2021-01-27 15:12:53
问题 Is there a way to reuse the window object? It may be necessary because the respective window may be generated dynamically. var electron = require('electron'); var app = electron.app var BrowserWindow = electron.BrowserWindow app.on('ready', function(){ var win = new BrowserWindow(); win.loadURL 'file://' + __dirname + '/index.html'; // now i want use the window object in my BroserWindow win window = win.getWindowObject; // like this window.document.write(); // i can use window object here });

Managing Session Cookies with Firebase and Electron

泪湿孤枕 提交于 2021-01-27 13:34:08
问题 I am trying to set up session cookies in my Node server, which is the backend for an Electron app. I am trying to follow this guide. https://firebase.google.com/docs/auth/admin/manage-cookies The first thing I am confused about is where this function comes from in the "Sign In" section: const csrfToken = getCookie('csrfToken') Is 'getCookie' a function I am supposed to write myself? I am also not fully following the logic of the "create session cookie" snippet: const csrfToken = req.body