Closed boblund closed 1 year ago
Could you please send the Gluon code you're using?
Hi,
It's the gluworld index.js loading a different index.html
import * as Gluon from '@gluon-framework/gluon';
(async () => {
const browsers = process.argv.slice(2).filter(x => !x.startsWith('-'));
if (browsers.length > 0) { // use argv as browsers to use
for (const forceBrowser of browsers) {
await Gluon.open('../owntonePled/index.html', {
windowSize: [ 800, 500 ],
forceBrowser
});
}
return;
}
await Gluon.open('../../owntonePled/index.html', {
windowSize: [ 800, 500 ]
});
})();
Here's the code that makes the HTTP request
function curl(cmd, method='GET', headers={}, body='') {
return new Promise((resolve, reject) => {
const http = new XMLHttpRequest();
http.open(method, `${href}${cmd}`);
http.send();
http.onreadystatechange = function() {
if(this.readyState === 4) {
if(this.status === 200) {
resolve(http.responseText);
} else {
reject(new Error('Failed to load page, status code: ' + this.status));
}
}
};
});
};
I tried the gluworld code with this:
await Gluon.open('http://localhost:3000', {
allowHTTP: true,
windowSize: [ 800, 500 ]
});
and my app works as expected. So, it seems the HTTP limitation is in the gluon backend that hosts my web app?
I also tried :
Gluon.open('../owntonePled/index.html', {
windowSize: [ 800, 500 ],
forceBrowser
}
and got
After clicking reload I get this console message:
file:///Users/blund/Documents/SW%20Development/gluon/examples/gluworld/node_modules/@gluon-framework/gluon/src/launcher/inject.js:64
let oldUrl = history.entries[history.currentIndex - 1].url;
^
TypeError: Cannot read properties of undefined (reading 'url') at file:///Users/blund/Documents/SW%20Development/gluon/examples/gluworld/node_modules/@gluon-framework/gluon/src/launcher/inject.js:64:64
at processTicksAndRejections (node:internal/process/task_queues:96:5)
Is any of your code using a .local URL? Also ensure that path in your code ../
is relative to your JS file, and that you're using the latest Gluon version.
Closing due to inactivity (and Discord should be used for support instead).
Hi,
I have a web app that accesses a JSON API over http. It work fine in Chrome. When I try it with gluon I get this error
The app serving the JSON API doesn't use HTTPS and I have no control over that. Is this a gluon restriction? Can it be by by-passed?
Thanks, Bob