Close.js
-
Continuing the discussion from The evil ideas thread:
Close.js
With close.js, you can close an iOS web app right from javascript! Just use the closewebapp() function.
function closewebapp() { document.write("<section id=\"sectionndjfrjvbjreiajjzkf\"></section>"); document.write("<style>"); document.write("#sectionndjfrjvbjreiajjzkf {"); document.write(" height: -webkit-calc(0% + 0px);"); document.write(" -webkit-transition: height 1s ease-in;"); document.write(" z-index:-999;"); document.write("}"); document.write("</style>") }
Edit: fixed syntax highlighting
So, apparently the reason why this exists is this.
Apple... Come on... We're not fucking babies. Sometimes we want to have some control over our devices. I wasn't dreaming of touching an iOS device before, but now I'll keep extra distance.
-
We're not fucking babies.
In their eyes, looking down at us from their shiny aluminum1 towers, we are.
1 Aluminium, for our friends across the pond.
-
-
So, apparently the reason why this exists is this.
The reason why it exists is a bug, obviously. It’s jokingly presented as a way to close an app by making it crash, but has not legitimate use.
Sometimes we want to have some control over our devices.
I prefer UI consistency myself.
-
I wasn't dreaming of touching an iOS device before, but now I'll keep extra distance.
+1
-
OF course "you" are not babies.....a lot of developers have not matured that far!
-
In their eyes, looking down at us from their shiny aluminum1 towers, we are.
is that because they are so high up it's hard to tell who is involved?
Filed Under: Sex jokes
-
I prefer UI consistency myself.
We can have both control and consistency!The reason why it exists is a bug, obviously. It’s jokingly presented as a way to close an app by making it crash, but has not legitimate use.
Well, as you can see from the StackOverflow answers, making an app exit is as simple as writingexit(0)
in XCode. However, Apple guidelines forbid app makers from using it (You're Doing It Wrong). I'm assuming there are plenty of products out there to wrap a website in an iOS 'app' but because the result has to be accepted by the app store, they are probably not allowed to create a JS API method to call XCode'sexit
function.
-
Well, as you can see from the StackOverflow answers, making an app exit is as simple as writing exit(0) in XCode.
It’s in the standard C API, so it’s not very surprising.However, Apple guidelines forbid app makers from using it (You're Doing It Wrong).
The UI guidelines say that the standard way to “close” an iOS app is to press the device’s home button. It does not say anything aboutexit
; it says that apps shouldn’t provide additional buttons that close them. Is it a bad thing that Apple enforces it?exit
exists on iOS merely because it’s based on a Unix-like desktop OS where applications are started and quit. It has no use in a standard iOS app because the OS manages the app lifecycle automatically. Explicitely exiting an app just makes it start more slowly the next time it’s tapped by the user; it does not provides any advantages (unless of course your app leaks memory, or do not free unused resources when the OS requests it).Also, have you seen the close.js source code? It’s a browser bug. Relying on crashing bugs in any app is a huge WTF: it will break when the bug is fixed (which is already the case for this bug) and will fill up the device with crash logs.
there are plenty of products out there to wrap a website in an iOS 'app' but because the result has to be accepted by the app store, they are probably not allowed to create a JS API method to call XCode's exit function.
I don’t think I’ve seen a web app with a custom close button ever (especially since browsers restrict the use ofwindow.close
, for obvious reasons)
-
Also, have you seen the close.js source code? It’s a browser bug.
That's why I made this thread.
the OS manages the app lifecycle automatically
Maybe I'm old-fashioned, but I like to handle these things myself...
(unless of course your app leaks memory, or do not free unused resources when the OS requests it)
...for precisely this reason. If Windows managed things this way, then I'd have to restart my computer every time a badly written program fouled up.
-
-
-
Wait a minute... if we just type [ quote="Apple"] it magically gets a logo?
@Apple said:Whatever
Hmm... I wonder.. @AppleEdit: that's what I figured, @boomzilla
-
I blame @apple
Edit: Hanzo'd
-
there are plenty of products out there to wrap a website in an iOS 'app' but because the result has to be accepted by the app store
If that's all the app is (a wrapper to a website), technically it's not supposed to be accepted to the app store. Only if the app provides functionality that Safari natively doesn't are "web apps" allowed.
-
Yes, that's also true. I knew this, but the context of close.js was actually brought to me by another developer who is making an internal app for their company, and has been given stupid requirements that boil down to a completely different set of WTFs.
-
-
-
Typical @Microsoft, jumping on the bandwagon.
Plus your avatar is messed up. Mine Just Works™.
EDIT: OK you fixed it now. iSupposeTheresAFirstTimeForEverything.
-
Mine works fine TYVM.
-
This is going to be the start of a beautiful relationship...
-
Hey @Apple, big shout out to the Geniuses in your store this morning, not only did your guys get my laptop sorted, but your guys saw me before my appointment time and I was leaving the store just as my appointment was actually supposed to start.
-
Oh dear. Is it time for me to step in...?
-
Hi?
-
-
Oh god, the duck's here.
-
Poor, poor linux. Your avatar is broken too.
Or did you just forget to install a GUI?
But that's the least of your problems.
-
No, it's just on a network drive, but @Microsoft is refusing to share it.
-
(EE) No devices detected. Fatal server error: no screens found
-
(EE) No devices detected.
Fatal server error:
no screens foundCareful, your Virtual Machine is showing.
-
STOP: c000021a {Fatal System Error} The Linux Process system process terminated, thankfully, with a status of 0x00000001 (0x00000000 0x00000000). The system has been shut down.
:D
-
Just pop into one of our stores and have a word with one of our geniuses. They'll be happy to upgrade you to a Mac
-
Sorry, I got all this hardware to run here...
Happen to have a driver for it maybe?
-
I don't think the
two tin cans and damp piece of string
driver is still supported.
-
Leaving that here because you guys hate XKCD
Filed Under: Or not... I never really figured that out. I just know that you guys will hate me for posting it
-
Creating random sockpuppets to impersonate corporations is Doing It Wrong™.
Derailing a thread is Doing It Wrong™.
Showing reply markers on comments that are replying to the comment directly above is Doing It Wrong™.
Posting XKCD images is Doing It Wrong™.Clearly, none of you are ready for my vision of the next 10 years of forum use. Get off my prospective lawn!
-
Broken avatar... how Discourse of you.
-
Oh god,
the duck'sshe's here.FTFY.
https://www.youtube.com/watch?v=aufL76bXLAg
Linux is Sexy on so many levels. ;-)
-
Creating random sockpuppets to impersonate corporations is Doing It Wrong™.
Strange that this is the only 'puppet to get flagged by @system (and it is @system, not @systern which I fully expected to turn up sooner...)
-
Strange that this is the only 'puppet to get flagged by @system (and it is @system, not @systern which I fully expected to turn up sooner...)
Flagged how?
-
Flagged how?
-
What did that get auto flagged for? Did it automatically detect that it's a sockpuppet?
If so, I wonder what heuristics they use...
-
Perhaps the repetition of Doing It Wrong made @system's spidey sense tingle.
Perhaps the repetition of Doing It Wrong made @system's spidey sense tingle.
Perhaps the repetition of Doing It Wrong made @system's spidey sense tingle.
Perhaps the repetition of Doing It Wrong made @system's spidey sense tingle.
Perhaps the repetition of Doing It Wrong made @system's spidey sense tingle.
Perhaps the repetition of Doing It Wrong made @system's spidey sense tingle.
Am I flagged as spam yet?
-
Given there have been 3 other 'puppets in the past hour or so, from disparate IP's I'm guessing it's not the mere fact it's another 'puppet.
@LoremIpsum's probably closer.
-
Cool.
-
I just wonder what singled that puppet out in particular...
-
-
I™ assume™ ™ triggers™ a™ spam™ warning™.
Pe®haps you a®e ®ight!
You ©ould ©e®tainly be ©o®®e©t.
-
-
Took a moment to see what you did there.