Code Monkey home page Code Monkey logo

astilectron's People

Contributors

asticode avatar benebsiny avatar bennetty avatar billymurrayolive avatar cbairy avatar dreisel avatar fregie avatar happy-ferret avatar john-devil avatar maddie avatar paolobelluticm avatar sbrow avatar scottkipferolive avatar sereeena avatar true-zero avatar vahid-sohrabloo avatar vocuzi avatar wickedst avatar worlpaker avatar yauheni-chaburanau avatar zerokiseki avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

astilectron's Issues

[Bug] lastWindow is always null in main.js

the last window gets updated in the index.js file but the exported instance is a reference to the original value, then when overriding the lastWindow the exported module is not being updated.

Support wss:// as binding address

Currently astilectron uses tcp socket to bind other languages stack, but the data over this connection are easy to be sniffered and insecure for renderer passing data like password or tokens.

Maybe we can consider when start() with [tcp://]ip:port and use the classic tcp way,
and when start() with something like wss://localhost[:port] , use ws to create a secured connection between clinet and language bindings.

Cheers.

clear electron cache

is there a way to clear the electron cache (besides rm -rf ~/.config/Electron/cache) ?

Type generation of structs

is there some type generator? I tried using tygo, but that got it's quirks, like generating

struct bla {
  Nested
}

as bla.Nested.propName but this refers to them as bla.propName

Guidance on extending Go <-> Electron Interop

Hi there,

I'm looking into adding some functionality to astilectron and am unfortunately running into barriers due to my unfamiliarity with the codebase. Hoping to get some guidance via this ticket, and will be happy to open up PRs for the enhancements I'm looking to make.

I'm looking to expose electron features like:

I've been experimenting with index.js to try and add the functionality I need but it's slow going. Namely I can't seem to figure out how to send and receive messages between Go and electron. The code that exists for this is so low level that it's hard to follow along with without educating myself on the entirety of the codebase.

Any chance someone could provide some pointers on how I would go above adding more interop between Go and electron? A simple "hello world" example for sending messages to/from electron would be tremendously helpful.

Thank you!

Ask - Hot Reload

Can i use hot reload. so when i change HTML / CSS, it will update styling without re run app?

State changes are not working properly with Astilectron + Angular

Hi,

I have an app that uses Angular 10 and NgRx, and I am having some difficulties with its state changes.

The problem is that the UI is not updating correctly given the state of the app. For example, if I click on a button to open a modal popup, the modal doesn't show until I click on something else on the UI and force it to update.

I've tested my app on the latest version of Chrome and on the latest version of Electron (9.1.2) and it worked fine. I also upgrade the Electron from Astilectron to version 9.1.2 but the error remained.

Here is an example:

astilectron

Notice that the modal only appears after I click on the arrows that change the screen.

This is how it looks like in Chrome when it is working:

astilectron-2

Has anyone experienced this? Can anyone help me?

Thanks,
Felipe

Forwarding Electron BrowserWindow to js code

Hi astielectron!
I am currently using Astielectron in an asti+react code. I am using electron webview tag inside js part of the application. According to Electron Docs webview tag is not preferred to use because of its instability. I would like to migrate from webview tag to Electron's BrowserView. Unfortunately, to manipulate with BrowserView I need to attach it to Electron BrowserWindow instance. Is it possible to somehow to forward BrowserWindow instance to js API of astilectron?

Exposing Dialog

I have edited my vendor/astilectron/index.js code to expose the dialog via the astilectron object.

Starting on line 536

  `const {ipcRenderer} = require('electron');
  const {dialog} = require('electron').remote;
  var astilectron = {
    dialog: dialog,
    onMessageOnce: false,
    ...
  };
  ...

This made it so I could extend vue/src/plugins/astor.js and further expose the dialog to the rest of my app.

Is this a good way to get access to the dialog object?

[discuss](added some webContents event)

Wow, in general, oauth always requires a redirect_uri(such as the github oauth), but electron usually use a filePath like that:


const w = new BrowserWindow({});
w.loadURL("file://path to project/index.html");         // use file path to .html

if the redirect_uri to set the file path, it will fail. If we want to use oauth in electron, there will be a way: open a new sub window to load the oauth url which the redirect_uri set to http://localhost, and electron listen will-navigate(when you first oauth) and did-get-redirect-request(when you have authorized) to send the newUrl. Like what the electron-oauth2 do.

I found that boths go-astilectron and astilectron do not define this event, I forked the projects and modify it:

astilectron/src/consts.js:

windowEventDidGetRedirectRequest: "window.event.did.get.redirect.request",
windowEventWillNavigate: "window.event.will.navigate",   // will trigger when first use oauth
astilectron/main.js:

function windowCreate(json) {
      ...
     elements[json.targetID].webContents.on('did-get-redirect-request', (event, oldUrl, newUrl) => {
        client.write(json.targetID, consts.eventNames.windowEventDidGetRedirectRequest, {
            url: newUrl
        })
    })
    elements[json.targetID].webContents.on('will-navigate", (event, url) => {
        client.write(json.targetId, consts.eventNames.windowEventWillNavigate, {
            url
        })
    })
}
go-astilectron/window.go:

EventNameWindowEventDidGetRedirectRequest = "window.event.did.get.redirect.request"
EventNameWindowEventWillNavigate                    = "window.event.will.navigate"

I modified it in my forking astilectron project and release a v.0.15.0 version(beacuse go-astilectron use VersionAstilectron and this attr is defined to 0.15.0), and I try this in my project and test it:


var ow, _ = a.NewWindow("http://github.com/login/oauth/authorize?response_type=code&client_id=31dbd4e343e060a20bdf&client_secret=c0a20c8b3bd912998779ad639077442e6b8b3ba9&redirect_uri=http://localhost", &astilectron.WindowOptions{
	Center: astilectron.PtrBool(false),
	Height: astilectron.PtrInt(600),
	Width:  astilectron.PtrInt(600),
})

ow.On(astilectron.EventNameWindowEventDidGetRedirectRequest, func(e astilectron.Event) (deleteListener bool) {
	w.SendMessage(e.URL, func(m *astilectron.EventMessage) {
		// Unmarshal
		var s string
		m.Unmarshal(&s)

		// Process message
		astilog.Debugf("received %s", s)
	})
	return
})

ow.On(astilectron.EventNameWindowEventWillNavigate, func(e astilectron.Event) (deleteListener bool) {
	w.SendMessage(e.URL, func(m *astilectron.EventMessage) {
		// Unmarshal
		var s string
		m.Unmarshal(&s)

		// Process message
		astilog.Debugf("received %s", s)
	})
	return
})

this gif is what I tested result:

1

this can use to other aspects that load url, I'm no sure what your opinion about this, so I open an issue to discuss it, if you think it is feasible, I will make some PR.

Invalid Electron cache path

The default Electron/Astilectron installation path is located inside:

C:\Users\Admin\AppData\Roaming\%AppName%\vendor

However, the Electron Cache is located inside:

C:\Users\Admin\AppData\Roaming\Electron

The Electron Cache should be located inside:

C:\Users\Admin\AppData\Roaming\%AppName%

This issue causes conflicts with other Electron applications that use the same cache path by default.
Reproduction can be caused using go-asilectron with the default parameters and a valid AppName.

Versioning of the application

Hi asticode,
I am trying to use astilectron and build an electron application. How to set the version of the application? How to make sure this version is available in windows.syso created in the application folder. Also, is there any way we can do auto-update of the application in Windows and Mac?

using astilectron with vue, error by not define

Dear bro,
I using astilectron with vue.
when "run serve" or "run build", the first time inform not define,
but I run the command twice, it successed, nothing changed.
the log is following.

`PS C:\hlp\02src\mygui\mmq\mmqfront> npm run build

[email protected] build C:\hlp\02src\mygui\mmq\mmqfront
vue-cli-service build

/ Building for production...

ERROR Failed to compile with 1 error 下午3:35:44
error in ./src/pages/Send/index.vue

Module Error (from ./node_modules/eslint-loader/index.js):

C:\hlp\02src\mygui\mmq\mmqfront\src\pages\Send\index.vue

✖ 1 problem (1 error, 0 warnings)

@ ./src/router.js 28:13-41
@ ./src/main.js
@ multi ./src/main.js

ERROR Build failed with errors.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: vue-cli-service build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\shuser\AppData\Roaming\npm-cache_logs\2021-12-09T07_35_44_683Z-debug.log
PS C:\hlp\02src\mygui\mmq\mmqfront> npm run build

[email protected] build C:\hlp\02src\mygui\mmq\mmqfront
vue-cli-service build

  • Building for production...

WARNING Compiled with 2 warnings 下午3:36:02
warning

asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets:
css/chunk-vendors.4cb5fce1.css (316 KiB)
js/chunk-vendors.03c58d10.js (1.6 MiB)

warning

entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
Entrypoints:
app (1.92 MiB)
css/chunk-vendors.4cb5fce1.css
js/chunk-vendors.03c58d10.js
css/app.a61f0562.css
js/app.c18a3fa1.js

File Size Gzipped

dist\app\js\chunk-vendors.03c58d10.js 1643.03 KiB 530.57 KiB
dist\app\js\chunk-45926f3b.086aa401.js 5.61 KiB 1.90 KiB
dist\app\js\chunk-fef40f70.b1e9ed1e.js 5.39 KiB 1.89 KiB
dist\app\js\app.c18a3fa1.js 5.05 KiB 2.18 KiB
dist\app\js\chunk-65588e0d.ff1d5f44.js 3.42 KiB 1.32 KiB
dist\app\js\chunk-2d5e931d.1658ec56.js 2.21 KiB 0.90 KiB
dist\app\js\chunk-db4206a4.81df13ea.js 2.20 KiB 0.88 KiB
dist\app\css\chunk-vendors.4cb5fce1.css 315.60 KiB 42.61 KiB
dist\app\css\app.a61f0562.css 0.02 KiB 0.04 KiB
dist\app\css\chunk-2d5e931d.0e433876.css 0.00 KiB 0.02 KiB
dist\app\css\chunk-45926f3b.8b5fefc0.css 0.00 KiB 0.02 KiB
dist\app\css\chunk-65588e0d.8b5fefc0.css 0.00 KiB 0.02 KiB
dist\app\css\chunk-db4206a4.0e433876.css 0.00 KiB 0.02 KiB
dist\app\css\chunk-fef40f70.8b5fefc0.css 0.00 KiB 0.02 KiB

Images and other types of assets omitted.

DONE Build complete. The dist\app directory is ready to be deployed.
INFO Check out deployment instructions at https://cli.vuejs.org/guide/deployment.html`

`package.json`'s `version` field isn't up to date

Inspecting the history it appears that it got set at "0.33.0" for v0.33.0, but has not been updated since.

I'd like to suggest that either this be kept up to date, or it be removed and an alternative method of finding the version for an install be provided. Thanks!

interupt will navigate

I need a programmatically interruption here to prevent site navigation on a page that generates a token. Would it be possible to have the a callback function?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.