Bug 1028113 - FTU skip homescreen migration on tablet devices

This code will not work as you expect, sorry, onsuccess is an asynchronous function.

If you execute the code as it's written now the result will be:
1. Retrieve the setting value.
2. Start the migration process.
3. At some point, maybe before but probably after point 2, fire onsuccess and execute the url verification.
 
Besides, the callback function as you have it now doesn't really do anything because it only exit from the callback function and doesn't affect the flow of the containing function.
 
To do what you really want to do, you need to put the migration code inside the callback function.
The easiest way to do this is moving the line 24 (closing of the callback function) after the line 44 (end of navigator.mozApps.getSelf().onsuccess definition). That way all the code will be executed only when the setting is actually retrieved, and the return will actually avoid the execution of the rest of the process.