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
991 stars 552 forks source link

Why Tampermonkey and other questions #1060

Closed OnkelTem closed 9 years ago

OnkelTem commented 9 years ago

I've started to learn IITC code, the building process and etc and I wonder - why IITC is tied to TM? Is my understanding correct that TM only plays the role of package manager - simple installation and further update checks?

fkloft commented 9 years ago

It's not tied to Tampermonkey, it runs on any Greasemonkey compatible script manager. Greasemonkey is the Firefox equivalent of TM and I think it existed before Chrome.

This is a simple way to modify websites across browsers.

OnkelTem commented 9 years ago

Thank you for the quick reply, @fkloft.

This is a simple way to modify websites across browsers.

Yeah, I sometimes use Chrome's TM to change fonts and backgrounds, to fix some inconvenient things on weird websites. TM is probably a simple way but it is IMHO a hackish way to do things.

IITC - is a complex application with (internal) modular structure, and I really wonder why it is not a Chrome/Firefox extension. But this is all matters of taste maybe, the real problems come when you try to develop or learn the code.

Chrome's TM stores scripts in the chrome storage which is not a filesystem, and therefore any convenient developing tools are simply not an option: there are no ordinary files. Also, since TM eval()s scripts they are shown as VMXXX and there is no way to edit scripts, they are displayed as read-only.

I read the HACKING.md and it seems that with Firefox developing is a bit more convenient.

OnkelTem commented 9 years ago

So my question is — why not an extension/app?

McBen commented 9 years ago

For developing ... a) use firefox. Greasemonky stores all scripts directly on the filesystem. b) use the build systems ( + add a copy command to autobuild)

FF contra: line-draw performance. requires the 'canvas' plugin. In the end it isn't able to draw dotted lines (I guess a leaflet-bug)..but this is okay for developing.

I don't see any benefit in an extension/app. It just massive increase dependency & the work for maintaining the code (chrome,ff,opera,safari, android,...)

johngh commented 8 years ago

@OnkelTem if you write for TamperMonkey you just write a single JavaScript file - very straightforward and simple and the same code is cross-platform compatible for Chrome (with TM) Firesux (with Greasemonkey) and even other browsers (like the Android TM browser).

If you write a Chrome extension, you have to deal with a number of files in different formats in a structured directory hierarchy, packaging those files, signing and validation of that package etc, getting it accepted by Google into the chrome web store, deal with politics and loss of availability if anybody (validly, mistakenly, maliciously or otherwise) complains about the extension to get it taken down. There have been MANY very useful Chrome extensions that have been removed from the chrome web store and once gone from there it's definitely non-trivial and these days a bit risky to circumvent Chrome's security to allow you to install extensions that are not provided via the web store... not to mention the headaches caused by your extension breaking when Chrome's version increments and they turn off functionality, change or remove APIs and lock things down like they do...

...and THEN, after ALL THAT you've only supported Chrome, not Failfuchs or any other browser. MUCH more to maintain, no benefit to the users. Better for the dev to leave the platform compatibility worries to TM & GM & do what he does best - getting out quick updates to keep IITC working well for us despite nia's ever-changing intel site regularly throwing curveballs to break it for everyone.

Don't be so down on Tampermonkey, I would rate it as by far the most powerful extension in Chrome. It provides a valuable enhancement to the browser and does it in a simple, robust and efficient way.

Oh, and... re storing files in the filesystem... TamperMonkey stores its files in the filesystem too, you just need to know where to find them ;-) but it's easier to use its script manager interface.

OnkelTem commented 8 years ago

@johngh

IMHO, there is nothing good in single file, as as the size of an app increases - supporting and developing it becomes pain. This is not a pros.

Firefox, Chrome and even Opera extensions differ in wrapper, but very close under the hood. And there is no need to publish the extension in the stores - it's dead easy to install packaged extension and even to update it IIRC.

IMHO, while I agree that TM provides some enhancements, being an eval()ed thing, a layer, it breaks normal development process to which we developers are accustomed to. This is not only TM problem, but more IITC's itself: it doesn't use modules and its building system is just throwing everything into one concatenated pile. The result of this — no automated testing, no modularity, no parts and no libraries updates. At that, there are lots of super handy tools out there to help in developing js apps but none of them are used. I think that the main reason for this — is TM as it breaks any motivation to build the app in the Right Way.

TamperMonkey stores its files in the filesystem too

I'm not confirming this, sir!

McBen commented 8 years ago

IMHO, there is nothing good in single file, as as the size of an app increases - supporting and developing it becomes pain. This is not a pros.

That's why IITC is not a single file!