Firefox's about:config for Safari - safari

I'm testing an extension that was developed for a Safari browser. Reseting Safari data doesn't clear the data saved by the extension (like username and password), nor does uninstalling it.
So I'm looking for Safaris configuration options. Essentially what is Safari's equivalent to Firefox's "about:config"

Advanced options in safari:
http://itc.virginia.edu/network/proxy/safari.html
But maybe you could ask in superuser look at this question:
https://superuser.com/questions/236558/how-to-clear-all-html5-local-storage-from-safari
This should work it's very weird that those credentials don't get deleted:
http://www.howtogeek.com/howto/apple/clear-all-browsing-history-in-safari/
http://www.techgainer.com/clear-remove-browser-data-history-passwords-firefox-ie-safari-chrome-opera/

The extension "likely" saves its data inside ~/Library/Safari/LocalStorage/ inside a file named: safari-extension_com.XXX.YYY , where XXX.YYY differs pending on the name of the extension. If you delete that file, it'll kill all of its settings, which should re-populate to the defaults when re-launched. Ensure you've quit Safari before deleting.

Related

How to open second chromebrowser with chromedriver using --user-data-dir, if user-dir is set by group policies

we try to open a second browser with the chromedriver so the dev can keep his chrome with all his tabs open, while developing the testcases.
We read and tried several threads how to use --user-data-dir and --profile-directory.
If we use it to open a second browser , we can see, that the new user-dir folder is created, the second browser opens but then we get the message "user data directory is already in use, please specify a unique value for --user-data-dir argument".
If we check the user-dir in the opened browser with chrome://version/ we can see that the user-dir is our compony default, even if we changed it with --user-data-dir.
I talke dto the chrome admin and they set the user-dir over group policies (GPOs). It looks like the GPOs overrule the --user-data-dir command.
Has anyone experiance with such a situation and a hint how to overcome it? Sadly we can not change the GPO because it has several dependencies and works for our whole company.
Thx,
Stephan

Firefox Ignores Content-Disposition

I'm trying to write MVC endpoint that will optionally set the content-disposition to inline or attachment in order to either display the file (a pdf) inside a new browser tab or else to download it. The UI allows the user to select how they'd like to open the file (not my design - can't change that aspect of it).
Note that this works in Chrome/Edge just as expected.
In Firefox, the application settings for PDF appear to trump the content-disposition. Is there a reliable way to get Firefox to respect the content-disposition? Preferably a way that will work w/ a vanilla installation of the browser such that end-users don't need to make any modifications on their end for it to work.
Here's the code I'm using to setup my response (class is derived from ApiController):
var response = Request.CreateResponse(System.Net.HttpStatusCode.OK);
response.Content = new PushStreamContent((stream, content, context) =>
{
dispatcher.Dispatch(request, stream);
}, new MediaTypeHeaderValue(MediaTypeNames.Application.Pdf));
response.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue(contentDisposition)
{
FileName = $"{auto_generated_fileName}.pdf",
};
response.Headers.CacheControl = new CacheControlHeaderValue()
{
NoCache = true,
NoStore = true
};
return response;
We have noticed this issue in our webapp as well. The webapp has a download button that lets the user download a PDF file. Firefox shows the PDF file in the current tab, which effectively kills the webapp.
After a bit of research, this appears to be an intentional feature, see the release notes for Firefox 98:
When you set an application to open files of a specific type in your Firefox preference settings, those files will open automatically, even files served by the website with "content-disposition: attachment". The same applies to PDF files that are set to open in Firefox by default. This is a fix to bug 453455.
Personally, while I can understand some users may want this for web pages that don't behave well, this is an issue for well-behaved web apps.
Setting the download attribute on the anchor does not appear to work either, Firefox still shows the file inline (tested with Firefox 99.0)
So as far as I am aware, you cannot force the browser to download the file if the browser does not allow it. Other web apps such as OwnCloud or Google Drive are having the same issue -- if you click right on a PDF file in Google Drive and then click on Dowload, Firefox still open the PDF file inline, whereas Chrome downloads it.
For now, it seems the best you can do is to open file in a new tab, to prevent the webapp or web page from being replaced by the downloaded file (which is also what Google Drive seems to be doing). You can open the download in a new tab or window e.g. via the target attribute on an <a> links or via the formtarget atttribute on a <button> element.
I found #blutorange's answer after trying to find a solution to the same problem as OP. However, just before I got here, I stumbled across this answer from back in 2013 - https://stackoverflow.com/a/16515146 which suggests to set the Content-Type header to application/octet-stream, instead of application/pdf.
I tried that solution and what do you know - it works! The PDF opens in a new tab in Firefox automatically, but at least it doesn't replace the tab of my application, so yay! Chrome doesn't seem to mind it either and my PDF viewer on my computer also recognizes the files as PDFs.
Now, this might not be the most "correct" fix to the issue we're facing, but it's an alternative to forcing open a new tab.

Chrome extension that changes the wallpaper of a new tab - NOT in Chrome OS [duplicate]

I am not able to run my content script on the new tab page (where it is not assigned to any url).
I looked at various posts on the subject, ie, Does content script have access to newtab page?
and What is the URL of the google chrome new tab page and how to exclude it from manifest.json
which seem to suggest it is possible.
I enabled chrome://flags/#extensions-on-chrome-urls
I have:
"permissions": [
"http://*/*",
"https://*/*",
"chrome://*/*"
],
(also tried "*://*/_/chrome/newtab*")
still no luck ... what am I missing ?
this answer Can you access chrome:// pages from an extension? mentsions "wildcards are not accepted". Is this true ? and if so how to specify the newtab page ?
The problem is that Chrome 61 and newer explicitly forbids access to the contents of its built-in new tab page (NTP) via content scripts or any other API.
The solution is to create the entire replacement page as an html file in your extension and specify it in chrome_url_overrides.
As for why, here's quoting [source] rdevlin, one of the developers of chrome extensions API:
There's a few reasons for this change. One is to enforce policy,
the other is for consistency.
We've had a public policy for awhile now that states that modification of
the NTP through anything other than Chrome URL overrides isn't allowed (though
we didn't begin enforcing this policy in many cases until July 1st). This is
merely bringing chrome code more inline with that same policy to help prevent
surprise if an extension is modifying the NTP and is taken down for policy
violations.
This is also for consistency, since we've actually treated scripts on the NTP
differently for years now, due to certain NTP magic. For example, the URL seen
by the browser on the NTP is chrome://newtab, but the url in the renderer is
https://www.google.com/_/chrome/newtab. Since chrome.tabs.executeScript checks
the URL in the browser, the script would be denied, even though content scripts
(checked in the renderer) would be allowed. In theory, these permissions should
not be different. Similarly odd, if the user is using the local ntp
(chrome-search://local-ntp/local-ntp.html), injection would already be
disallowed in both the renderer and the browser. And, if we go waaaaay back,
the NTP used to be pure WebUI with an URL of chrome://newtab, where injections
were again disallowed. Rather than have inconsistent behavior depending on the
type of script injection the extension uses, we want to have consistency
throughout the system.
P.S. Please don't edit the quoted text.

IE 10 not using AppCache after browser closed

I wrote an application using the HTML5 Cache Manifest and I'm having a problem using it in IE 10.
I used Fiddler to witness the manifest file being downloaded and all resources fetched on the initial load of the application. If I disable my network adapter to force the machine offline, the application continues to work as expected as long as I don't close the browser window.
However, when I close the browser window, then attempt to re-open the page from a favorite, IE 10 tells me "You're not connected to a network". Obviously I know that, I'm trying to use the app offline. These exact steps work in Chrome.
Is this behavior by design? Is there a workaround? I can't test with IE 11 right now...is this different in IE 11?
Hearing of some issues of the appcache clearing if your company utilizes gpo settings and has "empty temporary internet files folder when browser is closed" enabled.
Did you find the answer to this? I have the same problem. I did get a bit further though. I found that if you go to the IE10 File menu option and tick Work Offline then try and access your cached app it loads the page but I still have an issue as it does not appear to be using the javascript file that should also be cached. All works ok on Google Chrome but our clients are restricted to IE so Chrome is not an option.

Launching an executable from the web browser via link

I've seen a ton of games and what not opening their applications using links like "game://15.64.15.64:25876" or something.
I want to be able to launch my game's .exe from my website for users who installed it, and for it to work on any browser; At the same time I want to be able to pass a parameter (just 1).
What registry values would need to be added/modified for this to work for all browsers? If there's extra steps to setting it up in all browsers, can you explain these steps? Other questions I've found didn't quite help or worked only in IE. I require Firefox, Chrome, and IE at the least.
A similar question was asked here:
How do I make the website execute links?
You would end up with a structure like this in your registry:
HKEY_CLASSES_ROOT
game
(Default) = "URL:Game Protocol"
URL Protocol = ""
DefaultIcon
(Default) = "game.exe,1"
shell
open
command
(Default) = "C:\Games\YourGame\game.exe" "%1"
See this article on MSDN for details:
Registering an Application to a URI Scheme
As mentioned by OP, the above approach only works in IE. Here are some thoughts on how to make it work in other browsers:
Chrome: Is it possible to open custom URL scheme with Google Chrome?
Firefox: Writing a Firefox Protocol Handler
One way I can think is download a file from browser ( gamesession.gme or your extension)
and set your game as the default application for that extension.