Is there a way to set 'Disabled = false' of electron-simple-updater - electron

I'm wanna set up auto-updates features in my Electron App build in Quasar. So I come across with electron-simple-updater.
https://github.com/megahertz/electron-simple-updater#checking-for-update
I fail to implement it as the auto-updates just can't seem to work. Due to 'disabled' option always set to true, just like stated in the documentation.
I try
updater.setOptions({
"url" : "...",
"disabled" : false,
});
Then when I
console.log(updater.checkForUpdates());
It display
Update is disabled
It's not working. I'm able to set any options other than 'disabled'
Is there any way to force 'disabled = false'?
By the way, my environment is macOS v10.14.6

From the doc:
Your application must be signed for automatic updates on macOS.
To enable automatic updates on MacOS your app must be signed.

Related

Use ShareArrayBuffer from an electron app

We have an electron app which uses ShareArrayBuffer. It was written with a very old version of electron. When we updated the electron version in order to use SIMD instructions in WASM, it started showing an error saying ShareArrayBuffer is not defined. It seems it is due to the security update in Chromeum and ShareArrayBuffer is available iff Cross Origin Isolation is set.
Google shows some articiles explaining how to enable Cross Origin Isolation on web-pages, but I have not found any article that explains how to do that on an electron app. Does anyone have a pointer to the info or an idea to try?
Thank you,
It can be enabled by adding the following line in background.js
app.commandLine.appendSwitch('enable-features','SharedArrayBuffer')
Reference
As of December 2022, this is the only thing that worked for me:
browserWindow = new BrowserWindow({...});
// Enable SharedArrayBuffer
browserWindow.webContents.session.webRequest.onHeadersReceived((details, callback) => {
details.responseHeaders['Cross-Origin-Opener-Policy'] = ['same-origin'];
details.responseHeaders['Cross-Origin-Embedder-Policy'] = ['require-corp'];
callback({ responseHeaders: details.responseHeaders });
});

In a Firefox extension, if I open a tab using a custom scheme, how do I close it, because my extension is not authorized for that scheme pattern?

I have a custom scheme mapped on my Windows machine: "dbn".
So, when I put dbn:/some/arguments in the Firefox address bar (or click on such a link), it launches in another application. This works great.
However, in a Firefox extension, I don't know how to "call" or "activate" this custom scheme except by opening a new tab, like this:
browser.tabs.create({ url: 'dbn:/some/arguments' });
That works fine, except now I have an open tab with dbn:/some/arguments as the URL. I have attempted to subsequently close it from my extension, but I can't because:
Error: Missing host permission for the tab
My extension doesn't have permissions for that "host."
I have tried to give it permissions via a match_patterns value of dbn:* but that throws an error when I try to reload the extension because those values apparently have to use one of the expected schemes (http, https, ftp, etc.).
I end up just having to close the tab manually, which isn't terrible, but is clearly sub-optimal.
So, two questions:
Is it possible to "call" a URL in such a way to activate a custom-mapped scheme on Windows without opening a tab? The only way I could think of doing this in such a way that it would activate my mapped command was to open a tab, but are there other ways?
If opening a new tab is the only way to do this, how do I close the tab I just opened without having the permissions problem I mention above?
Update
I don't think it's permissions anymore. The Promise simply won't resolve.
browser.tabs.create({ url: "some/url" })
.then(tab => console.error("I never get here"));
I've debugged up, down, and sideways. The new tab opens, and I can write to the log all around that operation, but the code in then just doesn't execute, no matter what I put in there. I tried to trap an error with try...catch, but that didn't trap anything.
I now think that permission above was coming from a different extension, not my extension. I don't think this has anything to do with the host.
AFA custom schemes, there is an open bug: Extend match patterns to handle custom protocol schemes
You can tabs.remove() a tab by its ID which you get from tabs.create().
async function fun() {
// note this is async
const tab = await browser.tabs.create({url: 'dbn:/some/arguments'});
// later remove it
browser.tabs.remove(tab.id);
}
// or
browser.tabs.create({url: 'dbn:/some/arguments'})
.then(tab => {
// do what is needed
// later remove it
browser.tabs.remove(tab.id);
});
Update:
Regarding the Promise, there is not enough information to pinpoint the issue.
Which permissions have been set?
Where is the code running?
Use catch to get more info about the Promise failure:
browser.tabs.create({url: "some/url"})
.then(tab => console.log(`Created new tab: ${tab.id}`))
.catch(error => console.log(error.message));

Button Save disabled in ABAP Editor for Auto Completion

Recently I've installed the SAPGUI, and I want to turn on the auto-completion option "Suggest Non-Keywords from the Text".
But the button to save this setting is disabled.
How to save the setting?
Most likely a permission problem preventing the SAPGUI from performing updates.
C:\Users\\AppData\Roaming\SAP\SAP GUI\ABAP EDITOR\Settings.xml
Check how SAPGUI is Launched. Try launching with ADMIN rights.
Does your organisation restrict roaming profiles ?
Perhaps an admin guy there knows why you cant update
...AppData\Roaming\SAP\SAP GUI\ABAP EDITOR\Settings.xml
<Code_Completion>
<AutoCompletion>1</AutoCompletion>
<AutoOpen>0</AutoOpen>
<TimeOpen>1500</TimeOpen>
<UseExternalDict>0</UseExternalDict>
<UseLocalDict>1</UseLocalDict>
<QuickInfo>1</QuickInfo>
<CodeHints>1</CodeHints>
<KKCharsNum>2</KKCharsNum>
<AutoHideToolTip>1</AutoHideToolTip>
<AutoHideDelay>3000</AutoHideDelay>
<UseSimpleAutocomp>1</UseSimpleAutocomp> <<<<<< set this to 1
<CurrentScope>1</CurrentScope>
<Transparency>100</Transparency>
<HoveringDelay>500</HoveringDelay>
<HoveringInfo>1</HoveringInfo>
<CodeHintAgreeByReturn>0</CodeHintAgreeByReturn>
</Code_Completion>
For anyone facing this problem, I just uninstall and install the SAPGUI, and it solves.

Cordova: clean way to check if user has enabled push notifications

Seems like there is probably an existing cordova solution for this, but I can't find it other than the cordovaBadge plugin
- https://github.com/katzer/cordova-plugin-badge
- http://ngcordova.com/docs/plugins/badge/
Problem is I have had to remove this plugin due to conflicts with LocalNotifications. (Seems like I can't have them both)
The cordovaBadge has a simple .hasPermission() method. Is there anything else in the cordova library that can do this?
You could use the isRemoteNotificationsEnabled() method of cordova-diagnostic-plugin:
cordova.plugins.diagnostic.isRemoteNotificationsEnabled(function(isEnabled){
console.log("Push notifications are " + (isEnabled ? "enabled" : "disabled"));
}, function(error){
console.error("An error occurred: "+error);
});
Dear #vargen_ you're right!
I'm using this plugin together 'phonegap-plugin-push' - just to catch some new feature that exposed by #md repo (see push actions...).
Diagnostic plugin doesn't allow to know if permission was request or not ( like the 'not_determined' response of 'cordova.plugins.diagnostic.getRemoteNotificationsAuthorizationStatus' method available ONLY for iOS).
Strangely, when the app is installed for the first time (Android), permission for push is set to 'true' ( even if no one modal was shown ) -- tested onto android 8.1.0 .
Instead, if we use the 'RECEIVE_WAP_PUSH' value of cordova.plugins.diagnostic.permissionStatus object, like in the example provided here https://www.npmjs.com/package/cordova.plugins.diagnostic#requestruntimepermission permission seems to be always 'DENIED_ALWAYS'.
I'm very confused about how to manage the 'first' time case for this plugin for Android platforms.

Default Monolog messages with Silex

I'm using Silex 1.1 and Monolog 1.0.0. My code and my problem:
$app->register(new Silex\Provider\MonologServiceProvider(), array(
'monolog.name' => 'myname',
'monolog.logfile' => ROOT . '/logs/log.txt',
'monolog.level' => Monolog\Logger::INFO
));
. . .
$app['monolog']->addInfo('xxx');
Everything works fine, but I get default messages like these:
[2013-12-13 00:20:56] myname.INFO: Matched route "GET_api_v1_predictions" (parameters: "_controller": "predictions.controller:index", "_route": "GET_api_v1_predictions") [] []
[2013-12-13 00:20:56] myname.INFO: > GET /api/v1/predictions [] []
How I can disable them?
(If I change the logging level to WARNING and use addWarning then just my messages are displayed, but I want to use the INFO level).
You can still create a logger for your application which is not used by other processes:
use Monolog\Logger;
use Monolog\Handler\StreamHandler;
// initialize the logger
$app['mylog'] = $app->share(function($app) {
return new Logger('mylog');
});
$app['mylog']->pushHandler(new StreamHandler('/logfile/mylog.log', Logger::INFO));
$app['mylog']->addInfo('Private Log initialized');
Currently there's no way to disable them, the log commands are registered unconditionally.
The short-term solution is to copy MonologServiceProvider into your own app, change the log commands as you need.
The long-term solution is to fork the silex repository, change the MonologServiceProvider to provide a way to disable those commands, then create a pull request so everyone can enjoy your work.

Resources