iitc-project / ingress-intel-total-conversion

ingress.com/intel total conversion user script with some new features. Should allow easier extension of the intel map.
http://iitc.jonatkins.com/
ISC License
989 stars 552 forks source link

Add iOS installation via bookmarklet #833

Open angustrau-old opened 10 years ago

angustrau-old commented 10 years ago

IITC can be run on iOS by running a bookmarklet as shown here image It would be nice to have this method on the official installation page.

My code:

javascript:if (document.URL=='https://www.ingress.com/intel') {var head=document.getElementsByTagName('head')[0]; var script=document.createElement('script');script.type='text/javascript';script.src='http://iitc.jonatkins.com/release/total-conversion-build.user.js';head.appendChild(script);} else {alert('You can only use IITC on the Ingress Intel website!');}
jonatkins commented 10 years ago

Interesting suggestion! It could even be used in other cases - e.g. not wanting to install Tampermonkey on Chrome, using IITC in IE, or using other browsers on Android.

I could even create a simple config page on the website to generate a boomkarmlet with both core IITC and a selection of standard plugins.

As I don't have an iOS device to try, could you describe the exact process to create the bookmarklet? Assume I create such a config page, and it generates a <a href="javascript:...">IITC bookmarklet</a> link to store.

e.g. "long press on the "IITC bookmarklet" and choose "add bookmark"...

angustrau-old commented 10 years ago

http://www.ilegendsoft.com/m/videodownloaderfree/install_bookmarklet.html These instructions for another app sum up the simplest way to install a bookmarklet. I do have another idea by the way of linking the user to a data URI(http://en.wikipedia.org/wiki/Data_URI_scheme) and using JS to detect if they are on the Intel page. If not, show them instructions to add the page to their bookmarks.

user858753257 commented 10 years ago

nice idea. Any Progress ?

user858753257 commented 10 years ago

@amtra5 work that also on ios 8 beta ?

Galfinite commented 10 years ago

This does work, however due to security issues (and using the vp=m), I suggest a slight modification to the bookmarklet code:

javascript:(function(){if(document.location.origin+document.location.pathname=='https://www.ingress.com/intel'){var head=document.getElementsByTagName('head')[0];var script=document.createElement('script');script.type='text/javascript';script.src='https://secure.jonatkins.com/iitc/release/total-conversion-build.user.js';head.appendChild(script);}else{alert('You can only use IITC on the Ingress Intel website!');}})();

I have found that the bookmarklet method works best in Safari. Run the bookmarklet straight away, without waiting for the Niantic intel site to fully load. At least for me, if I waited for the page to fully load, safari consistently crashed.

As per @jonatkins's suggestion in #832, I am working to develop modifications to the main script to allow better iphone usage of iitc.

For a more streamlined process of deployment of these bookmarklets, I suggest that @jonatkins deploy something similar to what has been done by Digital Inspiration here.

umer936 commented 10 years ago

I actually like this a lot and has been working quite well for me. Additionally, through the test build, it allows passcode submission for iOS and tons of other devices!

I've been using this for now.

javascript:(function(){if(document.URL=='https://www.ingress.com/intel?vp=m'){var head=document.getElementsByTagName('head')[0];var script=document.createElement('script');script.type='text/javascript';script.src='https://secure.jonatkins.com/iitc/test/total-conversion-build.user.js';head.appendChild(script);var script=document.createElement('script');script.type='text/javascript';script.src='https://secure.jonatkins.com/iitc/test/plugins/fly-links.user.js';head.appendChild(script);}else{window.location.href = 'https://www.ingress.com/intel?vp=m'; alert('Run the bookmark again');}})();

Changes I made were to redirect the user to Intel Map if they aren't on the page, and alert them to rerun the script as well as adding Fly Links because that's the plugin I use most OTG. Additionally, it shows how to add multiple plugins fairly easily.

Working pretty well for now.

jonatkins commented 10 years ago

This hasn't been forgotten, but it's not currently high priority either...

My current plan is to create a web page on the iitc website, where you can configure a set of plugins to include with the main IITC script. This will generate the required bookmarklet and include instructions on how to save it on common browsers (iOS - and even Internet Explorer!)

umer936 commented 10 years ago

@jonatkins Shouldn't be too hard. I can probably whip it up by tonight.

umer936 commented 10 years ago

Got a chance to get around to it. I made it mostly with PHP because that's what I'm most comfortable with. Test it out and I'll be happy to send the source code. http://satxresist.com/IITCmw/ @jonatkins

user858753257 commented 10 years ago

@umer936

Yes it Works perfectly(player tracker). I have tryst it with an iPhone 5S. But I miss two things. 1. A close button for the "more detail" section

  1. The button for the layer chooser.

I think for iOS, iitc need a new design

Galfinite commented 10 years ago

The layer chooser was added in 57e972f by @leCradle - wonder why it isn't showing now?

umer936 commented 10 years ago

@Galfinite

It shows, it just doesn't fit on the mobile screen. Basically, the menu is too big and isn't scrollable, so half of it is off the screen.

finem commented 10 years ago

I've been looking at making a simple IITC Bookmarklet that boot-straps IITC and allows you to choose the plugins you want from within IITC.

Grawl commented 10 years ago

Here's working solution guys: http://satxresist.com/IITCmw/ (via @umer936 at #314)

cathesaurus commented 9 years ago

Just a heads-up, since I originally opened this issue, then left it fallow for... months...

My focus on iOS development went to zero, for months, but it's about to become 50% of my time, again. I'm really pleased that others have come up with creative solutions, in the meantime - I've used the bookmarklet, on Mobile Safari on iOS 4.2.1, and on Safari on Os X 10.9.5, and they work brilliantly. My focus in recent months has been on using the programming language Clojure (which compiles to Java VM bytecode) wherever possible, including to Android apps (via the lein-droid and neko projects, amongst others) and I believe there are projects to compile Clojure to iOS, so, once my current worload calms down some, that's my plan - create a Clojure wrapper, which always pulls from the latest test builds, and compiles to native Android and iOS apps. So that's the plan - a different version of IITC under Android (just for kicks) and a version of IITCm as a native iOS app (also just for kicks, also without expectation that Apple will list it in the App Store, but I'll open source it on Github for people to compile for themselves, and / or up to a hundred each of their closest iOS-using friends.)