Handle pop up notification in Firefox and Safari

I want to run a test in Chrome, FireFox and Safari
I have two pop notifications in the test, both needs to be allowed.
In Chrome I was able to solve this by adding profile.default_content_setting_values.notifications as 1 in the Desired Capabilities for Chrome.
In FireFox I tried to solve by adding permissions.default.desktop-notification as 1 and dom.webnotifications.enabled as true (in the Desired capabilities). But this is not working- i.e. unable to allow the notifications
Please Help in this case.
Also waht should be added for the same functionality in Safari ?

try to add like this way in script mode

WebDriver driver ;
FirefoxProfile profile = new FirefoxProfile();
profile.setPreference("permissions.default.desktop-notification", 1);
DesiredCapabilities capabilities=DesiredCapabilities.firefox();
capabilities.setCapability(FirefoxDriver.PROFILE, profile);
driver = new FirefoxDriver(capabilities);

Thanks, but still did not work

and issue is?

The popup notification is still on in firefox


tap Remember this decision and try

ok here some steps
(1) In a new tab, type or paste about:config in the address bar and press Enter/Return. Click the button promising to be careful.

(2) In the search box above the list, type or paste geo. and pause while the list is filtered

(3) Double-click the geo.enabled preference to switch the value from true to false

If you need to reverse that later, you can double-click it to switch it back to true.

or using code
FirefoxProfile geoDisabled = new FirefoxProfile();
geoDisabled.setPreference(“geo.enabled”, false);
geoDisabled.setPreference(“geo.provider.use_corelocation”, false);
geoDisabled.setPreference(“geo.prompt.testing”, false);
geoDisabled.setPreference(“geo.prompt.testing.allow”, false);
DesiredCapabilities capabilities = DesiredCapabilities.firefox();
capabilities.setCapability(FirefoxDriver.PROFILE, geoDisabled);
driver = new FirefoxDriver(capabilities);