The Progressive Web App (PWA) and Push Notifications providing both PWA and Push Notifications is too good to be removed from my forum. Still it comes with the implementation of Share-Buttons at different areas, like posts, user profile page etc., of which I have absolutely no need. I have a members-only forum where everything happens internally, so this share-button api is absurd for my case. I tried to remove it via css:
.item-share {display: none !important;}
but this leaves some ugly artefacts at places where the share-button is the only menu option:


So I did some more research and realized the cleanest approach would to make a separate minimalistic extension that disables the share buttons added by the askvortsov-pwa extension.
I tried with a js/dist/forum.js like:
(() => {
const { extend } = require('flarum/common/extend');
const PostControls = require('flarum/forum/utils/PostControls');
const DiscussionControls = require('flarum/forum/utils/DiscussionControls');
const UserControls = require('flarum/forum/utils/UserControls');
app.initializers.add("disable-share-buttons", () => {
function removeShare(items) {
items.remove("share");
}
extend(PostControls, "userControls", removeShare);
extend(DiscussionControls, "userControls", removeShare);
extend(UserControls, "userControls", removeShare);
});
})();
but despite working as expected, this caused many other extensions not to be loaded.
I have to admit, I'm a total noob when it comes to building flarum extensions and experience many obstacles, like I cannot complile directly because my webserver at all-inkl.com does not allow npm commands. (At least it allows composer.) Anyway - I'm having a hard time to do this on my own, so I'm asking for some help.
Does anyone of you have the generosity and skills to create a quick and dirty extension, that simply removes the share-buttons provided by the askvortsov-pwa extension?