How to close tabs with animation in Firefox 4? - firefox4

Moving my extension to Firefox 4, I noticed my old code closes tabs immediately :
gBrowser.removeTab(tab)
While in Firefox 4, tabs are being closed with some animation if the process was initiated by a user.
How to programmatically close tabs in the same manner?

Had the same question and found the answer somewhere else...
gBrowser.removeTab(tab, {animate: true});
And you probably already know that the preference is browser.tabs.animate.

Related

Bootstrap 5 open Modal from another Modal without closing first one

I am trying to open confirmation modal from modal without closing first one but it seems Bootstrap 5 has different behaviour than 4 version.
Below Bootstrap 4 version that works as expected
https://www.codeply.com/go/NiFzSCukVl
Below Bootstrap 5.1.2 version only difference with version 4 example is attributes are now data-bs instead of data-
https://www.codeply.com/p/imDoS33VZx
Is there any work around to solve this issue or am I missing something ?
According to the Bootstrap docs:
Toggle between multiple modals with some clever placement of the data-bs-target and data-bs-toggle attributes.
For example, you could toggle a password reset modal from within an already open sign-in modal.
Please note that multiple modals cannot be open simultaneously —this method simply toggles between two separate models."

How to disable Ionic gesture for go back to previous page

It seems ionic has the gesture for go back to previous page auto turned on, how to disable this feature.
As I already answered here just use the following line of code in .config of your AngularJS module:
$ionicConfigProvider.views.swipeBackEnabled(false);

UILocalNotification actions and snoozing

I'm working on a custom app for a client and am still relatively new to iOS development. The app involves setting reminders and I'm using UILocalNotifications. Now from my research the action on the notification will always run the app but I'm really hoping someone can correct me on that. Also from what I've read you are limited to the 'View' or 'Close' options. Ideally I'd love to have 3 buttons on the notification and not have to open the app to perform an action.
I'd like a 'dismiss' option, 'snooze' option, and an 'ok' option that dismisses the notification but runs some code in the background.
I came across a notification related question where somebody suggested opening the app with a modal view and presenting the options from there. Possible, just not as clean, I guess.
Any other ideas or is this what I have to do to achieve my desired functionality? If that's the case is there a way to close the app after I've selected one of my options from the modal view?
Thanks in advance.
That is not possible, as the notification is not created by your app but by the system, so you can't customize the appearance of the notification. (also in iOS 5, the user can choose to display the notifications as banners instead of alerts, which would hide any other button than the view and close button, if that were to be possible).
Secondly there is no way to close your app, as iOS is a user centric system, where the user takes the decision on whether to open or close app, and not the app itself.

iOS Safari flag for stopping page motion?

I'm curious if anyone has found a solution to disabling the default spring-loaded iOS page move when a user drags their finger across the page. For pages that are completely visible (i.e., no scrolling is necessary) the page moves and springs back into place.
I've found that disabling the "touchstart" will effectively fix this, but then it breaks all click events!?! For example:
document.addEventListener('touchstart', function(e) {
e.preventDefault();
}, false);
I've tried other touch / mouse events but no luck. I'm guessing someone out there knows a secret webkit CSS or JavaScript property which can disable this feature.
Edit: as an example of what I'm looking for, here is a similar answer for disabling other default iOS Webkit behaviors via CSS. Unfortunately these don't seem to apply to my question:
Prevent default Press but not default Drag in iOS MobileSafari?
I could have sworn I tried this, but it appears "touchmove" does the trick?
document.addEventListener('touchmove', function(e) {
e.preventDefault();
}, false);
Update: After more testing, yes this does in fact do the trick. It seems as though one should never e.preventDefault() on 'touchstart' as that also prevents all other mouse events that follow.

Wicket Pagemap Correct Use

I'm working on an app. with a homepage that contains two iframes. Each one of these iframes is refreshed every 5 seconds. Also, from the homepage the user can open several popup windows. Right now, when I open one of the popup windows, and reload it 3 or 4 times, one of the iframes in the homepage crashes because of a PageExpiredException. My question is, what would be the right way to use PageMaps to avoid this PageExpiredException? Also, the back button won't be available, so I don't need to keep previous versions of any page in session, is there a way to tell app. not to store previous versions of the pages?
Thanks,
Juan.
Each window, frame or iframe should have a PageMap of its own, so they don't conflict with each other. When you create the initial URL of an iframe, use the urlFor(PageMap,Class,PageParameter) method, so that page and pages navigated from there are part of that PageMap.
Stateless pages don't go into the PageMaps, so if a window only shows stateless pages, it doesn't really matter what is its PageMap (you may use the default).
If you upgrade to Wicket 1.5 (in RC right now), you don't have to worry about that anymore, since they discarded the whole PageMaps concept.