Great, this was exactly the problem. The item I want to remove was added by another extension and console.log(items.has('superfluousNotificationPreference'));
returned false
.
Changing my code to:
app.initializers.add('me/myextension', () => {
extend(NotificationGrid.prototype, 'notificationTypes', function (items) {
console.log(items);
items.remove('superfluousNotificationPreference');
});
}, -10);
... caused console.log(items.has('superfluousNotificationPreference'));
to return true
as well as my extension to work as desired.
PS: This would would probably have been handy in this case if it were compatible with the latest Flarum version. But I understand, that other tasks have a far higher priority than working on this extension.