Trying to update my old-styled Safari extension with background HTML page according to native app extension. The extension should perform HTTP requests in a background mode, and the earlier version used the same cookies that Safari did. But after migrating to native code, NSURLSessionDataTask can't access cookies that Safari has anymore.
Can anyone suggest how can I manage this case? Unfortunately, I can't pass cookies via messages to 'native' code (they are httponly).
Related
I am developing an outlook web addin, in the taskpane I have a cookie sent from the server with httpOnly. For the same session cookie is handled correctly, when I close the task pane and re-open the cookie seems to be cleared.
This does not happen on Mac, does not happen on Windows when the browser used by outlook is IE11.
Seems to be happening only when the outlook uses edge as it's engine.
Is there something I can add in the manifest perhaps to avoid this cookie clearing?
Adding to #BrianClink's response, the session cookie probably works on most versions that use Internet Explorer to load the add-ins. Whenever an add-in is closed, Internet Explorer stays alive for a while, which probably preserves the session cookies. Since we switched to Microsoft Edge, this is no longer the case. So please don't rely on this behavior for preserving cookies.
I have custom web browser which is build using COM and Active X control using C++ or MFC.
In custom web browser am passing the my URL/Page which is having code to load the recaptcha " " its not loading buts its working fine in normal browser.
https://www.google.com/recaptcha/api.js i can see in the fiddler this URL is redirecting to webworker.js, anchor.htm and bframe.htm.
but from custom web browser after this "https://www.google.com/recaptcha/api.js nothing happening i mean its not redirecting to webworker.js, anchor.htm and bframe.htm.
I have use the IDocHostUIHandler if want you can grow through the following links "https://msdn.microsoft.com/en-us/library/aa770041(v=vs.85).aspx#WebBrowser_Customization_Architecture"
I have enable the downloading in my custom Web Browser i can see the downloaded files such the script, theme, css or html page and also "recaptcha__en[1].js" in machine expect webworker.js, anchor.htm and bframe.htm.
Please Help me out.
Thanks and Regards
I want to write a Safari Browser Extension on macOS (the latest extension model, https://developer.apple.com/library/content/documentation/NetworkingInternetWeb/Conceptual/SafariAppExtension_PG/) which needs to perform an HTTP-request within the browser's context (getting and setting cookies etc.) which is a cross origin request to another domain.
The Google Chrome extension model and the new Mozilla Firefox WebExtension model allow this by performing the request in the background page JavaScript of the extension.
The deprecated NPAPI model allows this directly with the native API provided by the browser.
The old Safari Extension model (https://developer.apple.com/library/content/documentation/Tools/Conceptual/SafariExtensionGuide/Introduction/Introduction.html) also allows this in the background page JavaScript.
However, the new Safari Extension Model does not have background page scripts at all, as the "background" is directly the native sandboxed extension process.
In a content script of the extension I can perform an HTTP-request within the browser context, but I do not have cross domain permissions there.
I can perform HTTP-requests natively in the extension process (NSURLDownload, CFHttpStream, WebView object/NSMutableURLRequest, using cURL library, ...) but this has no connection to the browser's HTTP context.
I have not found any way to perform HTTP-requests via the Safari Services API (SFSafari*-classes).
Do I have to use the "old" Safari Extension model (Xcode 8.1 already does not allow me to add an "Safari Extension Companion" target to be used for the old model, there is only the new "Safari Extension" target)? I always want to use the newest technologies if possible.
Has anyone an idea?
Thank you for your hints,
Dominik
I am not sure whether it is an issue of FireBreath or an ActiveX specific thing or I have just forgotten something.
I want to a download a file in my plugin using a derivative of FB::DefaultBrowserStreamHandler, and FB::BrowserHost::createStream(). The file is only accessable if my http request is authenticated by a cookie.
The built FireBreath plugin is working under Chrome and FF, but not under IE. The thing is that under IE no session cookie is sent when analyzing the requests with Fiddler.
Thanks in advance.
This is a feature that isn't supported the way you need it to be in FireBreath's activex implementation of browserstreams. You'd have to go into the code and find a way to add support for setting the cookie manually, I'm afraid. The reason it works in npapi browsers is that the browser itself provides an API for making the request, which means it will provide proxy info and cookies. In IE we have to emulate that, and that emulation doesn't get the cookies.
I need to access DOM of web application that is running inside Chrome browser.
Same functionality can be achieved quite easily with IE using
SHDocVw::ShellWindows and SHDocVw::IWebBrowser2. Now I have to support Google Chrome and it seems that there is no simple way to achieve that.
The Chrome browser doesn't expose its DOM to external processes. You need to be in process. So in order to access the Chrome browser's DOM you need to be inside a Chrome extension.