Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New window without neutralino api #124

Open
lucasengithub opened this issue Sep 1, 2024 · 1 comment
Open

New window without neutralino api #124

lucasengithub opened this issue Sep 1, 2024 · 1 comment

Comments

@lucasengithub
Copy link

So, im trying to create a window.

        window.parent.Neutralino.window.create('/installdrop.html',{
            title: 'Instalar',
            width: 400,
            height: 200,
            icon: '/resources/icons/installer.png',            
            resizable: false,
            alwaysOnTop: true
        });

installdrop.html has this html script link:

    <script src="/js/neutralino.js"></script>
    <script src="/js/installer.js"></script>

But i get this when trying to use Neutralino Api in the new window

SyntaxError: Unexpected identifier 'Neutralino'

@Jatin24062005
Copy link

Hi @lucasengithub ,
The maybe in Code not in Neutrilino library.

Here’s a step-by-step guide to debug the issue:

1.Initialize Neutralino in installdrop.html:

Add this to your script:

window.addEventListener('load', () => Neutralino.init());
console.log('Neutralino initialized');

2.Check Resource Paths:
Ensure neutralino.js is correctly loaded using absolute paths:

<script src="http://localhost/resources/js/neutralino.js"></script>

  1. Enable Debugging:
    Add enableInspector: true to Neutralino.window.create options for easier debugging.

  2. Verify Script Execution:
    Add console.log statements to /installdrop.html to confirm the scripts are loaded.

  3. Inspect the New Window:
    Open the developer tools (F12) in the new window and:

Check Console for errors.
Check Network to confirm all scripts load correctly.

  1. Confirm Neutralino Availability:
    Log the Neutralino object in the console to ensure it's defined:

console.log('Neutralino API:', Neutralino);
Let me know your findings after these steps! 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants