safari extension: Is there a way to read cookies - safari

I want to port an extension from Chrome to Safari. Chrome extension is using Chrome.cookies api http://code.google.com/chrome/extensions/cookies.html, is there any similar method for safari extension?

Such API is available for plugins only. The only workaround is to inject script then send document.cookie back to background page

Related

how to make headless chrome to work using protractor for window authentication pop up

I want to support window authentication pop up for login to the application using Protractor using chrome headless browser. Is there any way in which I can make it work?
I have already tried:
Chrome authentication extensions - https://www.npmjs.com/package/authenticator-browser-extension
Loading URL in the below format:
http://username:password#url.com which did not work out.

How to disable the notifications on Edge and Safari browser using selenium java

How to disable the notifications on Edge and Safari browser using Selenium and Java?
I have used the following code to disable the notification on the browsers.
caps.setCapability("disable-infobars", true);
caps.setCapability("--disable-notifications", true);
But it is not working as expected. Do I miss anything here?
Just figured out a way to close Push notifications on safari.
Try navigating to the URL twice, this seems to automatically adding the URL to Notifications DENY list.
driver.navigate().to("");
driver.navigate().to("");
Rajesh

How to listen to "beforeNavigate" event in safari app extensions

I'm developing a safari app extension. I've to listen to "beforeNavigate" event as in old Safari JS Extensions, we could listen to these events using Safari's Windows & Tabs API.
I went through the How to create Safari App Extension, but unfortunately couldn't find anything related to these events there.
Can anybody please help me with similar APIs for Safari App Extensions as we had in old Safari JS Extensions.
Starting Safari 13, Apple added an API for page navigation notifications.
In your SafariExtensionHandler.swift, you can now override func page(_ page: SFSafariPage, willNavigateTo url: URL?).
Source: https://developer.apple.com/documentation/safari_release_notes/safari_13_release_notes
Unfortunately, there is not equivalent in Safari App Extension.
The only thing you can do is catching a new tab id displayed through validateToolbarItem.
Or try to add a content or network filter in your App...

Open a Safari browser from Telerik AppBuilder

Telerik AppBuilder is using it's own "webview", but Apple store cannot accepts donations through app unless it's done thought Safari browser... Is there any way to open Safari browser inside App?
Thanks
You should be able to use the InAppBrowser plugin, but use the target of "_system". See the docs for more details: https://github.com/apache/cordova-plugin-inappbrowser/blob/master/doc/index.md
Use the second argument "_system" to open the link in the default browser.
Omit it to open with in the app.
window.open("www.google.com", '_system');

what is the equivalent option for displaying a notificationbox in chrome extension like in firefox addon

I am developing extensions for a site for major three browsers (FF,Chrome,IE).
I started with firefox and now working with chrome.
I want to know how to implement an option like the firefox xul notificationbox https://developer.mozilla.org/En/XUL:notificationbox in chrome?
How to display the do you want to save password panel in chrome like in firefox notificationbox?
I inspected LastPass and found that they are injecting a div inside the body tag as the first child of the body tag. is that the way it has to be ? or some other option?
There is an experimental API for this: chrome.experimental.infobars.
Until it gets stable creating your own div is the only option.