-
Notifications
You must be signed in to change notification settings - Fork 435
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Safari] Tampermonkey as 'Safari App Extension' ? #558
Comments
Apple said:
If it's going to be deprecated/eol'd why on earth would they want to do this? I literally just documented this installation process in the last week.
If only this were a real quotation. ;) |
I'll port Tampermonkey to this new technology if it's doable with reasonable effort. My second child was born these days, therefore it might take a little bit. I'm not a MacOS user, I use it only to debug Tampermonkey. Does anyone know or can estimate when Safari 13 will be released? |
I've never looked into this as that platform is my least utilized, and liked, however they do make announcements at https://developer.apple.com/news/ from a quick search. |
Your question is 'when will 13 be the normal consumer browser', i.e. 'when will current Tampermonkey fully stop working for random Mac users?' -- right? Not 'when can I get ahold of Safari 13 to test this crap?', which is what I started to answer as 'when can I get ahold of any version of Safari which would display this fecure?' Along those lines I had written the following (before realizing I was answering the wrong question): ==== Judging by https://twitter.com/digital_saas/status/1003910017953640448 -- Mac OS 'Mojave' is out in beta and apparently (as one might expect) comes with the beta of the next Safari, i.e. 12. If you have a virtualization environment on your Mac, you could install the beta in that. There's also https://developer.apple.com/safari/download/, which currently claims to be offering release '57' (?!?), posted May 28th, which might be new enough. I don't have a Mac to try it on. (Hmm, I downloaded and busted it apart and it appears to be build '13606.1.18' which the Internet says is only Safari 11.2. Also, the associated Release Notes haven't even mentioned Extensions since release 44, and 'App Extension' isn't mentioned at all. And I am now angry at Apple for having a beta series whose version numbers are completely unrelated to the release product's version numbers, and no dates in the beta log!) ==== Returning to your real question: careful parsing of https://wikipedia.org/wiki/Safari_version_history shows that Safari N.0 has been released along with Mac OS 10.(N+2).0, for Safari versions 6 through 11. Therefore Safari 13 will likely accompany Mac OS 10.15. Mac OS since 11.7 has been released on a fairly regular 12-month cycle, so we can predict official release of Mac OS 10.15 + Safari 13 around 2019-09-01, ~15 months from today. |
@derjanb Developer signed .safariextz extensions are "unsupported", and any such extensions will be removed and cannot be reenabled when Mojave launches in September. Safari Extension Gallery Extensions are "supported", but get disabled by default, and support for them will likely be removed with macOS 10.15 next year. Here's what the RN for Beta 1 says: |
@filbo Thanks. This was exactly what I was looking for. :) Given this timeframe, I'm confident to port Tampermonkey (if technically possible).
@yashendra2797 I do have a official developer certificate from Apple (99€ per year), but my request to be added to the app store was denied some years ago. So yes it's signed by me, but by using a certificate from Apple. From what I've read the difference is that developer self-signed extensions are not updated automatically while developer(-via-apple-certificate)-signed extensions are updated. So at least at this point there is a difference which makes me hope that "developer-signed .safariextz extensions" means the self-signed unofficial ones. |
Yeah but Apple is trying to make the MAS the only way to have an extension work on Safari, and for every extension wants you to make a pseudo app. That reminds me, couldn't you theoretically use a cert to make an app and use that to push extensions? You can disable Gatekeeper in macOS, and if its anything like installing an app, you could maybe use that to push an extension, unless Apple simply closes down Safari from any and all non MAS shenanigans. |
macOS 10.13.5 as of yesterday
Right clicking and opening with Safari Technology Preview... yields installation success and also script incercept/injection for runtime occurs as expected. Ping me with a mention if a test is needed. I usually keep that system up to date (whenever I connect to it) but rarely use it. |
@Martii the 'Safari Technology Preview' is pre-11.2, while the version people are getting in their Mac OS Mojave betas is pre-12. As far as any of their doc seems to indicate (though actually they're just completely unclear about it), these new-degraded 'Safari App Extension' things are new with 12. So if you want to provide @derjanb with a test platform for that, you would need to upgrade your whole OS on that test machine to pre-Mojave; or install that in a VM. (Unlike other x86 OSes, Mac OS insists that it may only be installed into a VM on official Apple hardware; while I'm sure there are software workarounds for whatever copy-protection-ish method they use to enforce this, the most straightforward route to having a Mac OS VM is to do it on a Mac.) I think I got that @derjanb does have his own Mac. Probably the best route (in his copious spare time...) is for him to install a Mojave VM on his own machine. Not upgrade the whole OS, because then he'd lose the ability to easily support the majority of Tampermonkey-on-Safari users who will be on the current official release version. |
Haven't had much luck with that in vbox or even getting a download medium that doesn't crap out (Apple has a bad history of deleting their installation files much like Adobe)... but that's usually under Linux. Not sure the machine is good enough for a VM though... and never again will I waste thousands of dollars on a machine that can be outperformed for much less. :) So when it dies it'll die... or more likely be eol'd like they did my PPC from the Intel switch.
Test bed is definitely not for that. Even though it's rarely used I usually need release status instead of beta/alpha (or whatever apple is calling it these days... I'm old school). Thanks for the intel. |
@derjanb The wording is: 'Safari no longer supports developer-signed .safariextz packaged legacy Safari Extensions. At first launch of Safari on macOS 10.14, if users have any legacy developer-signed They should accept it, as otherwise Safari will completely lack any ability to run the large pool of userscripts extant in the world (as there is no official 'Gallery' port of Violentmonkey or Greasemonkey, nor do those seem likely); and this is a large impairment for a browser. However, they might take that as a feature, i.e. keeping riff-raff external code out of their walled garden. And their statement is that while the technology (.safariextz) will keep working through the Safari 12 / Mac OS 10.14 timeframe, the delivery mechanism you're using (developer-signed .safariextz not hosted in the 'Gallery') is completely disabled ('cannot be reenabled') starting with Safari 12. Either way, it seems clear you're going to need to get into the 'Gallery' -- probably within 3 months (with an Apple-corporate-signed .safariextz) if Safari 12 users are going to have a userscript runner at release time, and definitely within 15 months (with a 'Safari App Extension') for Safari 13 users. Bleah. |
What's ironic is other browsers can run extensions on macOS... so this is two-faced for fact. Reminds me of the litigation against IE and integration into the OS... perhaps it's time to create another one for apple. And people wonder why apple products are my least favorite... bloated and beyond egocentric imho. Anyhow... they should elaborate more on why instead of a generic scripted response. You will never know until you try. |
@derjanb There's at least one extension relatively newly on the Gallery at the moment which has a feature for injecting custom scripts. I won't name it in case it wasn't meant to be approved since it's not the main goal of the extension, but also isn't a hidden feature so but it might indicate they've changed their stance. Also thanks for the link to my blog post, that solution works perfectly for me in the meantime and by the number of views I'm getting on that post it seems like other people too! |
It is obvious that you cannot 'address' the 'issue' per se; you cannot remove the ability to run 3rd party scripts from a tool whose entire and only purpose is to run 3rd party scripts. The alternative approach is to present that this is a capability which is widely desired and used in the real world. Include whatever download statistics you have for Tampermonkey-on-Safari (which is entirely through your own properties, since they haven't put it in the 'Gallery'); and perhaps similar statistics re: Chrome, Opera, Edge, even Firefox -- giving both broken out and combined stats for 'store' vs. your own site, since in some of those cases it is downloadable from both. Including stats for multiple browsers shows broad as well as deep interest. I think >10M downloads and 4.69 stars (right now) on Chrome Store should be at least a little persuasive... In resubmitting, I would recommend referencing both of these Wikipedia pages: Userscript (on the general concept) and Wikipedia:User_scripts/List (as an exemplar of what they're for, why people want and use them). HOWEVER, before doing that, someone(*) ought to update the Wikipedia pages Userscript and Userscript_manager to mention Tampermonkey & Violentmonkey, and de-emphasize Scriptish (which appears to be effectively defunct). The wiki pages are something like 3-5 years stale. (Do mention Violentmonkey in the wikipedia page, as it is another currently viable solution and again demonstrates broad interest in such capabilities.) (* Not me, I am not a Wikipedia editor...) @grgarside, your linked 'how to install safariextz-like-Tampermonkey in new degraded Safari' page is currently in flux due to (1) not starting automatically, (2) user reporting settings being lost on restart. Would you mind posting a comment here when these issues are resolved? In the end I'll be wanting to refer Social Fixer users to that as a temporary pinprick through the veil of stupidity being drawn over Safari... |
@filbo I've updated the article with what I can, ⑴ an AppleScript for automatically running the extension and ⑵ a way to avoid the settings being lost by locking the preferences file. I will continue looking for improvements to the process — if I end up having to write a completely separate app for managing these kinds of extensions then so be it! Let me know your thoughts |
>10M weekly users! 😉
Tampermonkey was listed some time ago but removed including some other extensions with the comments "removed obvious advertising and promotion" and "rmv link spam". So naming the script manager that is used by maybe 90% of all userscript users is SPAM/advertising. 😂 However, I'm working on submitting Tampermonkey to extension galery again. We'll see how this works out. If it succeeds, then I can start to investigate the new Safari App Extension API. Otherwise it doesn't make sense to work on this if there is no chance to be hosted by Apple. |
Well they may get some constructive negative PR from an official source if they aren't clearer on why. Saying a Safari extension would damage a mac is ludicrous imho. If that's ever true that would be apples responsibility/fault exclusively for not fixing their security issues... sticking their head in the sand and say it is secure isn't a wise idea. ;) I wish you good luck @derjanb :) *crosses things*. |
I am unfamiliar with app extensions and have been reading conflicting information. However, while it appears Safari App Extensions are the only way forward, some developers are saying that you can distribute an app binary outside of the Mac App Store that contains a Safari App Extension using Developer ID. They don't necessarily need to be approved by Apple in the MAS to be able to run on our machines. Theoretically, Tampermonkey could be distributed as a signed (and eventually notarized) app package that contains the extension. This is assuming, of course, the API makes it technically possible for Tampermonkey and userscripts to run at all. Is anyone more experienced able to confirm if Safari App Extensions can be installed outside the MAS with Developer ID? |
I was able to build a macOS containing app with a Safari app extension, and gave the signed app to a friend. He was able to open the app and have the extension install automatically, though he had to manually tick a checkbox in Safari's preferences to actually enable the extension. No app store required, though $99/yr Mac dev certificate still required. So I don't think you necessarily have to have MAS approval to release an App Extension, unless Apple changes this policy in the future. Still it seems like a serious amount of work may be required to port non-trivial legacy extensions like tampermonkey for safari. I've been porting a few .safariextz extensions I use for myself to the app extension model, just to see how this works. The simple ones that just inject a start/end script are easy. But the App Extension API (currently) provides no Javascript-friendly global.html / background.html. Code that used to be in global.js / background.js has to be rewritten in native Swift or Objective-C code, to run in the app extension's native process. Seems like a lot to ask browser extension devs to do for a niche browser. |
I hope that I can embed something like a WebView that loads my background page with the possibility to send messages to native Swift or Objective-C. This is how the Android apps are working... |
Note that Safari App Extensions are also available on macOS 10.13, so you can develop and test there without having to use the 10.14 beta or the Safari Technology Preview. |
Post a link and I'll send $20 towards your developer account ;) hopefully others would join too. All apps have sandboxes. Extension runs within the sandbox of the app which installed it. Same approach as on iOS. Creating downloadable extension installer should be a long-term solution. uBlock have just released their "app" on Apple Store. For TamperMonkey it would have to be manual download. |
Please do your best to find a way to make it work. Safari 12 seems to much faster than Chrome and I don't want to g back to that resource hog. I don't mind donating too but I think that if you publish it to Appstore you can charge like $1 for it and nobody will complain. As long you don't try to make a profit out of it, people would be happy to pay a little bit for assuring that development continues and that we can use user scripts in Safari. |
As signing a Safari extension currently already requires a developer certificate, which requires a $99 developer account already, is the $99 actually the problem here? |
No, I already do have a developer account to sign Tampermonkey. |
Hi, when I go to my dashboar to check out installed script, it is always loading showing please wait. |
Look forward to this. OUJS, via probably myself, will need one for documentation purposes. I am rarely on macOS but giving TM under Safari some PR needs one. Won't be able to request until this weekend though... still working through a few hw changes myself. 😃 |
where do the files go when I "save to file"? On Firefox, I get a popup prompting me for a location; on Safari, I just get the "I'm busy" spinner briefly and then it goes away and I've no idea where the files have wound up. (thanks for developing this into an app at such short notice, btw; I'm a diehard Safari fan and hate to have to use anything else) |
Meta: on https://apps.apple.com/us/app/tampermonkey/id1482490089, the three 'Screenshots' images are too small to be useful, and do not seem to have any way (like hover or click) to see a larger version. This is when viewed from Opera on Linux; I wouldn't be at all surprised if it works much better on Safari. And, whatever this is, it's almost certainly an Apple web site problem, not your uploaded metadata... |
... must be browser incompatibility. Ripping into the source of the page, it offers no less than 8 different zooms of the 1st image, all the way up to a very clear 1280x800. |
@Martii No problem, I keep some codes for internal purposes. Just mail me to and I'll send you a code. BTW: how do I recover my account at oujs? |
@waider Data should be stored at |
On 15 Oct 2019, at 22:52, Jan Biniok ***@***.***> wrote:
@waider Data should be stored at ~/Library/Containers/net.tampermonkey.SafariApp.Extension/Data/Downloads/ which should be linked to the user's Downloads folder. In case this fails files are stored at ~/Library/Containers/net.tampermonkey.SafariApp.Extension/Data/Documents/.
Aha, the Documents folder it is. Thanks!
Cheers,
Waider.
|
@paulzhang1992 Please see #778 |
This release made my day and I happily paid for it, no promo code needed. Enjoy your vacation, this is great work! Thank you! |
The best news I have heard today!!!!! First is that the icon on the browser is a little bit weird ? |
Same here. I can't get my scripts to work properly, because they need to be arranged in a certain load order in Tampermonkey... but I can't access the dashboard, it's just the blue/green spinner forever. My Mac is 100% up to date with software as of now. Rebooted Mac, Tampermonkey still won't load Dashboard. I'm also seeing the icon graphical error that other users are reporting in the Safari Toolbar at the top. |
You can check out this: but their method doesn't solve my loading problem. |
It seems like Tampermonkey is trying to load this, for some reason: https://ui.tampermonkey.net/favicon.ico But it's a 404 |
First of all: Thanks a lot for Tampermonkey and for porting it to the App Store! Leaving out the country should forward users to their current country’s App Store. So This works, unlike everything documented in QA1633. Is there any chance you can do a release with deployment target 10.13? I’m stuck on High Sierra (old MacBooks) and Safari 13 has been released for 10.13, too. |
@dhoepfl Please see #558 (comment) 😞 |
Sorry, missed this one. I assume you already tried something like the following: func tampermonkeyGetContainingTab(of page: SFSafariPage, completionHandler: @escaping (SFSafariTab) -> Void) {
if #available(macOS 10.14, *) {
page.getContainingTab(completionHandler: completionHandler)
} else {
SFSafariApplication.getAllWindows { windows: [SFSafariWindow] -> Void in
for let window in windows {
window.getAllTabs { tabs: [SFSafariTab] -> Void in
for let tab in tabs {
tab.getPagesWithCompletionHandler { pages: [SFSafariPage]? -> Void in
if let pages = pages {
for let aPage in pages {
if page === aPage {
completionHandler(tab)
}
}
}
}
}
}
}
}
}
} If so: 😢 |
Great job. Tampermonkey is working now. |
@derjanb The Apple Store says it requires macOS 10.14 or higher. Is it possible to make it available for 10.12 and 10.13 in the future? |
It is too expensive. |
Just bought the application. Amazing work man, you made my day! |
It doesn't look like the file does stay around. At least on my pc it does not contain any tampermonkey data. |
Hi, is there a way to get Tampermonkey for Safari 13 on OS X 10.13.6? I am stuck at the moment after High Sierra upgrade which force upgrade Safari from 12 to 13 which broke Tampermonkey extension. The latest Tampermonkey on App Store will only work on OS X 10.14 which I don't want to upgrade to. Thank-you. update - ok, I just re-read one comment above, looks like it's not possible. Will have to look to Chrome or Firefox, dang it. |
@ursinus1 Please see #558 (comment) |
FYI: I found a way to make Tampermonkey work at macOS 10.13 as well, but there are some drawbacks! Please see #854 (comment) for more information. |
Hi,
Apparently .safariextz style extensions are deprecated (but still operable) in the upcoming Safari 12, and 12 is 'the last release to support them', so either Safari 13 or possibly 12.1(?) will completely drop them. See https://developer.apple.com/documentation/safariextensions for details.
The replacement schema is at https://developer.apple.com/documentation/safariservices/safari_app_extensions/building_a_safari_app_extension, with supposed conversion doc at https://developer.apple.com/documentation/safariservices/safari_app_extensions/converting_a_safari_extension_to_a_safari_app_extension
As far as I can tell, this is Apple's official 'we're getting out of the browser business, just shoot us now' announcement. Instead of adding support for WebExtensions (even borked support like in Edge), they're jumping a fleet of buses over an ocean of sharks, off into some weird Neverland where every browser extension has to have a bag-on-the-side MacOS native app attached to it. But I may be misreading. It's sure as heck presented like that, anyway.
Be that as it may:
Can authors of userscripts rely on any hope of Tampermonkey bridging over this ridiculous gap and continuing to work on Safari 13?
The text was updated successfully, but these errors were encountered: