Вопрос

I'm developing an application and I need to prevent browser back button on some pages (which capture information).

I tried to implement a solution from a blog (http://jordanhollinger.com/2012/06/08/disable-the-back-button-using-html5) but it is not compatible with Fat Free routing engine.

I would like to guaranty the information integrity. When the user is filling a form the app disable all the menus and links in order to prevent the user to exit the page by error, so loosing the data captured. Two more possible exits (possible causes of error) are: 1) The browser left arrow (for navigating back) and 2) the Url bar. I am concerned with #1 not with #2.

Apart from this, there is also something awkward for the user when navigating back: it could result in an ERR_CACHE_MISS, the page do not exists anymore!

Has anyone implemented a solution in FatFree to prevent navigation back form browser back button?

Это было полезно?

Решение

The general problem:

"Browser functionalities such as bookmarks and the "back" button allow users to request pages from web applications in unpredictable ways. When incorrectly handled, an unespected request from the user can execute an unintended action, produce a cryptic and confusing error message, or even expose details about the application that can be exploited for malicious purposes" (Hallé, Ettema, Bunch and Butan, 2010*)

The particular problem:

"The developer therefore becomes resposible of writing customized mechanisms for these (...) features, a tedious and cumbersome task" (Ibidem).

The particular defect in Fat Free:

"In an MVC application, the handling of navigation constraints should clearly be the responsibility of the controller. However, MVC-based applications do not fully exploit this feature" (Ibidem).

This seems to be the case of Fat Free framework: there are no plugins or mechanisms to respond to this problem, very actual nowaday, for example in SaS.

In conclusion it seems to be no solution offered to such a problem in the current version of Fat Free.


Source (*) http://www.cs.ucsb.edu/~bultan/publications/ase10.pdf

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top