Fix share method from browser context menu

Some refactoring of the code broke also context menu's share option.