Is it possible to write a Safari extension that changes the web browsers preference settings?
If so where would I find documentation on this? I would like to add a search engine to the list of default ones so if there is already an extension that does this that you know off that would also be great.
Unfortunately the answer to your question would be a No, at least for now.
As to where you can find out more about this information, you may refer the MDN documentation on browser settings.
Related
I was planning to port over my chrome extension Tab Resize to Opera. I'm using the chrome.system.display API to get the user's display information in order to support multi-screen setups.
I wanted to check if there were plans to support the display API. It's the only thing hindering me from porting over the extension.
Thanks,
Peter
We will implement the API in Opera 30.
We are hoping to upload a chrome extension and publish it as unlisted (as the visibility option) via the Chrome Webstore Api.
So far we have been able to upload but not publish using this documentation -- we can't publish because extensions have a whole bunch of required parameters (like a screenshot or small-tile image) which we can't figure out how to attach. We are really hoping that one of these parameters will be visibility, and we can set it to "unlisted".
If any kind soul has any knowledge of the Chrome Webstore API, or how to set these parameters, our whole development team would be very appreciative.
The documentation on this is very sparse: https://developer.chrome.com/webstore/webstore_api/items/update
Quoting Using the Chrome Web Store Publish API:
Note: Currently, there is no API for setting an item’s metadata, such as description. This has to be done manually in the Chrome Web Store Developer Dashboard. More detail about the Web Store API can be found here.
So, to the question whether you can supply all the metadata programmatically - the answer is "no". And the Publish method does not seem to support "unlisted".
While debugging why my extension doesn't work in Safari (but does for other browsers), noticed that I can send an arbitrary made up HTTP header with XmlHttpRequest in a Safari toolbar extension. But try to do same with header named "Cookie" with same content as before, it doesn't get sent.
So does Safari restrict sending back cookies with requests or you need to follow an alternate process to do so? Seems kind of lame since this blocks functionality of apps that require session state persistence for example. If there's an alternate process, Apple made it harder to maintain session state in extensions (extra work in adapting a web app or other browser extension).
I tested using Safari 5.1.7 on Mac OS X 10.7.5 with Charles proxy.
Just figured I should post the solution that worked for me, that I commented in my own question earlier, for easier viewing by others with similar problem:
Turns out for Safari extension, what works for me is to set the browser to not block any cookies and website data. So users would have to do that to use the extension. No code changes needed. But that's not cool though.
The particular step is Safari > Preferences > Privacy > Cookies and website data: Always allow (at least under Safari 10 on Mac OS Yosemite). Although one could try "Allow from websites I visit" to see if that more restrictive option will work or not.
I have created a custom App URL for my iOS app. The URL format is similar to this:
myappname://texttobeparsed
This works fine when I paste the URL in safari, My App opens and correctly handles the URL. The problem is that other apps such as iMessage or Notes do not recognize this as a URL.
Why isn't this URL scheme being recognized as a URL? Could it have to do with how I set it up in my info.plist file or something else?
Or, does the URL need to be in a different format to be recognized?
I know it's possible to have the system recognize it as a URL in apps other than web-browsers because I've seen it before with other apps (ex. iTunes: itms://itunes.com/apps/appname or Twitter: twitter:// or Facebook: fb://).
There's nothing you can do about this. If the link isn't explicit (e.g. in an HTML email), these apps can just recognize a built-in set of standard URL schemes. itms:// is one of Apple's own schemes (for the iTunes Store), so it makes sense that it is supported in addition to the standard mailto://, http://, tel://... schemes.
Edit: I would guess that the information that is used to determine what constitutes a valid URL in text views etc. is cached somehow. Contrary to what I initially guessed, it seems that app-specific URLs do work in Notes, etc. I've tested this with tweetbot:// for example (which I have installed) and twitter:// (which I don't have installed) to verify that it doesn't just check for a pattern like *://, but actually uses information about the installed apps.
I'd suggest that you try to restart your device. If it's an issue with some cache, that might help and I don't think there's much else you could do if your URL scheme already works in Safari.
Update: I've installed the official Twitter app to test this, the twitter:// scheme wasn't immediately recognized in Notes, but after killing and restarting the Notes app, it worked.
Update 2: I've done a minimal test app with myappname:// as a custom URL scheme. Again, like with the Twitter app, it worked after restarting the Notes app, so it doesn't seem related to the popularity of the app or whether it's been submitted or not.
I can't answer as to why it's not working (beyond guessing that the link interpreter is hard-coded to only recognize certain URL schemes), but I can say that the typical way around this is to link to a web page, and have the web page redirect to your custom scheme.
It's slightly less elegant, because the user will see Safari open up briefly before being forwarded to your app, but it's also more robust because the web page can provide a link to the app store to install the app if it is not installed on the user's phone.
Google Chrome has ProxyPlus and Firefox has FoxyProxy among others. I was wondering why Safari has no counterpart in its Plugin gallery. There seems to be great need for such stuff in countries where Internet is censored.
I would like to develop one myself. But firstly I would like to know whether it is possible using Apple's API and whether Apple allows such extension. And if so, why no one ever comes up with it?
Any pointer about APIs are also welcome.
Thanks.