Settings

Theme

I ported the Firefox Archive.today extension to Safari

apps.apple.com

121 points by codingpanic 3 years ago · 46 comments

Reader

therealmarv 3 years ago

You don't need an extension for that and allow questionable privacy settings like "access to all websites". Just use a bookmarklet (create a new bookmark e.g. in your top bar and add this code as URL):

  javascript:location.href='https://archive.is/?run=1&url=%27+encodeURIComponent(document.location)
Other bookmarklet examples (12ft, Google Cache):

  javascript:location.href='https://12ft.io/proxy?q=%27+encodeURIComponent(document.location)

 
 javascript:location.href='https://webcache.googleusercontent.com/search?q=cache:%27+location.href;{}
  • dundarious 3 years ago

    Shortcuts are good for this type of functionality as well, and as a bonus, can be used from within apps like Twitter via the share sheet.

    • LordDragonfang 3 years ago

      For any non-Apple-users browsing this comment thread, "Shortcuts" is Apple's visual-scripting automation language for iOS and MacOS.

      https://en.wikipedia.org/wiki/Shortcuts_(app)

    • KMnO4 3 years ago

      Shortcuts are actually very underrated since they can run JS on webpages. A lot of things are possible that wouldn’t otherwise be possible on iOS.

      • codetrotter 3 years ago

        Sounds intriguing. I currently copy the URL of any page I am interested in and then open a new tab, click the favourite for archive.is and then paste the URL and hit save. Then I do the same with web.archive.org/save

        If shortcuts can make this process faster and require fever steps when I use them, I would like to have a shortcut for each of those two archive sites.

        Anyone have good shortcut to share for either of the two archive sites?

        I found some but neither of the ones I tried were quite perfect. The one for Wayback Machine navigated there but did not automatically start the save. The one for archive.is activated reader mode after archiving.

        • dundarious 3 years ago

          I would not seek perfection from a Shortcut. A 90% solution is commonly achievable though. I shared an archive.ph one in another comment.

          As for Reader mode, I think you just need to go to the site again, hit "aA", "Website settings", and disable "Use Reader mode automatically".

  • runjake 3 years ago

    You beat me to it.

    Personally, I have been using this variant:

      javascript:location.href = '//archive.ph/newest/' + location.href.split('?')[0];
  • maliker 3 years ago

    I've been doing this for years but missed the run=1 argument in archive.today to go directly to the latest copy instead of the list of all copies. Thank you!

codingpanicOP 3 years ago

Finally published my first anything on the Apple AppStore by porting the Archive.Today extension to Safari. Works on iPad, iPhone, and Mac.

I was tired of copying and pasting when I wanted to use the Archive service on HN articles, so here you go!

dundarious 3 years ago

Congrats to the author.

I’ve been using a homemade Shortcut for the same purpose. They’re great when you want a bit of control over such things. For example, expanding the url (following all redirects) before sending it to archive.ph/md/is, 12ft.io, or Reading List, etc. It’s very annoying having t.co urls in Reading List in particular.

  • devracca 3 years ago

    Can you share the shortcut or explain how it works. I dont have much experience with custom shortcuts yet.

    • dundarious 3 years ago

      https://www.icloud.com/shortcuts/9053ccad1b4c4c688537ebf4716...

      You can edit the resulting url before opening it or copying it, and choose between archive.ph, .md, etc. Editing is useful if you want to get rid of utm_source arguments, etc.

      Apple’s Shortcuts is just a hodgepodge of built in functions, the best way to learn is just to try build something like this. You’ll be searching a few times for the little function you want until you find the right name for it. As far as discoverability goes, it’s OK, gets the job done. Naming things is weird too — let’s say you make a Text block, then you can only seem to name it when you reference it elsewhere (Select Magic Variable, scroll and tap it, then highlight it and Rename from the menu).

js2 3 years ago

Note: you have to both enable the extension and set its permissions for "All Websites" to "Allow". If you have its permissions set to "Ask" then it will take you to archive.ph but not actually load the current tab's URL.

This explains the behavior folks are commenting on here where it appears not to work.

  • codingpanicOP 3 years ago

    Thanks for the feedback, I'll work on fixing this. Alternatively, you can also open an issue here: https://github.com/gnormandin/Archive-Page/issues

    • codingpanicOP 3 years ago

      New build submitted.

      • HeavyFeather 3 years ago

        I don’t see any changes on the repo. The permissions in your case should just be activeTab and storage. That’s it.

        You can run the extension via chrome.browserAction.onClick and it will receive the URL. You also don’t need the tabs permission just to create a tab.

        • codingpanicOP 3 years ago

          The issue is that if you do not set permissions in the manifest, clicking allow in the safari UI would only return a blank URI, "". The original extension in this case would also just return an error.

          I've modified the manifest so that it is asking Safari for wider permissions, so that when the permission is granted by the user, the proper URL is returned.

          • HeavyFeather 3 years ago

            I think that’s a Safari bug with activeTab, you just have to click twice.

            Regardless, with activeTab you can just inject script into the page itself through which you can open a regular popup.

                chrome.scripting.executeScript({
                  func: () => window.open(' archive.ph' + location.href)
                })
            
            Currently the extension will suggest that it needs access to every page the user visits, occasionally opening a popup automatically if I remember correctly.

            For something that’s a glorified bookmarklet, that’s a lot to ask.

Tempest1981 3 years ago

Thank you!

Just tried it at Bloomberg.com and wsj.com -- it redirected me to https://archive.ph/ and then again to https://archive.ph/

I'm on latest iOS.

  • codingpanicOP 3 years ago

    Yeah, there should be two redirects. The first is searching for the URL you entered, the second should either newly cache the page, or load the cached page. Same behavior as firefox.

    If this is not what you are seeing, please open an issue on the github at: https://github.com/gnormandin/Archive-Page/issues

    So I can keep track of issues encountered.

    Thanks!

    • Tempest1981 3 years ago

      Ah, yep, changing the permissions from "Ask" to "Allow" is a workaround:

      Settings > Safari > Extensions > Archive Page > All Websites > Allow

    • codingpanicOP 3 years ago

      Issue fixed, and a new build has been submitted

Sporktacular 3 years ago

Thank you. Nice to see some love given to Safari.

xylo 3 years ago

Here's my bookmark that works on Web, iOS, iPad

  javascript: (function() {(function(){var url =window.location.href; let newUrl 
  ="https://archive.ph/submit/?url="+encodeURIComponent(url.split('?')[0]); 
  window.open(newUrl, "_self");})()})()
pbj1968 3 years ago

Maybe include some more verbose instructions on the screen that displays on my iPad when I attempt to open the app. Following instructions from other posters on this thread has it working beautifully. Thanks!

KiDD 3 years ago

It isn’t loading the website url into the archive search

louhike 3 years ago

Is it region lock? I cannot access the page from France.

marban 3 years ago

Surprised that this sailed through MAS's review.

LeoNatan25 3 years ago

It only redirects to the Archive homepage.

  • CameronBanga 3 years ago

    You need to go into the Extension preference page for the extension, and hit the "Allow Access" permission box for allowing access to web url/link information. I can't remember exact wording, but should essentially be one option here and you have to enable it so that it has permission to pass along URL.

    • codingpanicOP 3 years ago

      This will no longer be needed with the next release, awaiting app review approval.

  • codingpanicOP 3 years ago

    This should be the expected behavior when pressing the button on a new Safari tab. Otherwise, should redirect to the URL your current open tab is displaying.

    • LeoNatan25 3 years ago

      Then something in the UX is broken. From your store images, I understood that clicking on that tab menu item, it would display last archive date and ask to rearchive, no?

      There is a reason why most Safari extensions apps do not just show an icon and a label, but actually explain how to use their embedded extensions.

brainzap 3 years ago

thank you

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection