[Library] Neutron.ahk - AutoHotkey Web GUIs on Steroids (now for v2!)

Post your working scripts, libraries and tools for AHK v1.1 and older
jsong55
Posts: 323
Joined: 30 Mar 2021, 22:02

Re: [Library] Neutron.ahk - AutoHotkey Web GUIs on Steroids (now for v2!)

05 Mar 2024, 07:58

Agreed. Is there a way to setValue?
jollyjoe wrote:
07 Jul 2023, 12:02
Can I update an element without triggering it in the HTML?

Example:

I want this element

Code: Select all

<div class="expiration" id="exp">INACTIVE</div>
to turn into this: (automatically after the neutron page loads)

Code: Select all

<div class="expiration" id="exp">TEST</div>
using this:

Code: Select all

neutron.doc.getElementById("exp").innerText := "test"
This is what I've tried so far (to no avail)

Code: Select all

#Persistent
#SingleInstance ignore

;some code to initially verify if my license is valid
;and store it into a var (license)

mm := new NeutronWindow()
mm.Load("html/home.html")
mm.Gui("-Resize +LabelGui")
mm.Show("w410 h483")
settimer, Link, 1000 ;tried to make it update every 1s but nothing happens automatically
return

Link()
{
	global neutron
	neutron.doc.getElementById("exp").innerText := license ;I want this to "happen" without the need for triggering it with html.
}
Any help would be greatly appreciated.

I wanna add: I also dont want to trigger it via a hotkey. I just want it to run at the beggining of the script when the page first loads, Is this possible?
zhang
Posts: 7
Joined: 29 Oct 2022, 20:08

Re: [Library] Neutron.ahk - AutoHotkey Web GUIs on Steroids (now for v2!)

20 May 2024, 09:53

jsong55 wrote:
05 Mar 2024, 07:58
Agreed. Is there a way to setValue?
You can use JavaScript
Just like this

Code: Select all

js := "
( ; js
	function ChangeElementInnerText() {
		let test = document.getElementById('exp');
		test.innerText='TEST';
	};
)"

Clicked(neutron, event) {
	; event.target will contain the HTML Element that fired the event.
	; Show a message box with its inner text.
	MsgBox "You clicked: " event.target.innerText
	;Using AHK to execute JavaScript functions
	neutron.wnd.execScript("ChangeElementInnerText()")
}
william_ahk
Posts: 652
Joined: 03 Dec 2018, 20:02

Re: [Library] Neutron.ahk - AutoHotkey Web GUIs on Steroids (now for v2!)

23 Jul 2024, 05:36

@geekdude I have found a way that does not need writing the registry for getting out of IE7. Just initialise it with the compatibility meta tag.

Code: Select all

Gui Add, ActiveX, vWB w500 h600, about:<meta http-equiv="X-UA-Compatible" content="IE=edge">
yuhuofei
Posts: 8
Joined: 15 Aug 2024, 01:44

Re: [Library] Neutron.ahk - AutoHotkey Web GUIs on Steroids (now for v2!)

10 Sep 2024, 20:32

I have reviewed all the comments and did not find any similar issues as mine. Is it normal for you to compile it into EXE?
0ec1e7e5-6c93-4252-ae2d-85eb6d5a18ba.png
This is what I look like after running AHK
0ec1e7e5-6c93-4252-ae2d-85eb6d5a18ba.png (909.69 KiB) Viewed 693 times
549876f3-d3f0-474f-b32a-3ae96a2a73f9.png
This is what it looks like when I compile it into
EXE
549876f3-d3f0-474f-b32a-3ae96a2a73f9.png (183.67 KiB) Viewed 693 times
This is a very simple login page, I even commentedout my JS code, leaving only HTML and CSS.

I happily finished writing all the interfaces, but
after compiling, I found that none of them could
be used. What went wrong? Is it a problem with my
environment?

All interfaces displayed normal compatibility when
I opened them on IE11 web pages, but they cannot
be used after compilation. Or is there anything un
supported about this library? \Why is everything r
unning normally in AHK?
yuhuofei
Posts: 8
Joined: 15 Aug 2024, 01:44

Re: [Library] Neutron.ahk - AutoHotkey Web GUIs on Steroids (now for v2!)

10 Sep 2024, 20:46

Additionally, I did not find any issues when compi
ling the author's demo into EXE. Is it because thi
s library does not support most HTML and CSS?
User avatar
Chunjee
Posts: 1601
Joined: 18 Apr 2014, 19:05
Contact:

Re: [Library] Neutron.ahk - AutoHotkey Web GUIs on Steroids (now for v2!)

12 Sep 2024, 08:22

You should be able to compile without issue,

In my index.html it looks like this:

Code: Select all

<link href="bootstrap.min.css" rel="stylesheet">
<script src="jquery.min.js"></script>
<script src="bootstrap.min.js"></script>
And the ahk looks like you might expect:

Code: Select all

; fileInstall all gui dependencies
fileInstall, gui\index.html, gui\index.html
fileInstall, gui\bootstrap.min.css, gui\bootstrap.min.css
fileInstall, gui\bootstrap.min.js, gui\bootstrap.min.js
fileInstall, gui\jquery.min.js, gui\jquery.min.js
For more details you can see https://github.com/Chunjee/ppa-wordleboost


bootstrap 4.x requires jquery and such. so leaving out all the js may be part of the issue.


I compiled from scratch to make sure. Neutron.ahk is still working on this Windows 10 machine.

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: No registered users and 42 guests