Firefox continue run async code even if page is reloaded or stopped
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
People
(Reporter: kes-kes, Unassigned, NeedInfo)
Details
Attachments
(1 file)
|
2.93 MB,
video/mp4
|
Details |
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:79.0) Gecko/20100101 Firefox/79.0
Steps to reproduce:
The code is:
btnPayment.append( document.createTextNode( 'Проводка' ) );
btnPayment.addEventListener( 'click', ( e ) => {
var rows = data_table[1].getSelectedRows();
if( rows.length == 0 ) { return }
var data;
if( rows[0].getCell('oper_new').getValue() ) { data = false; }
else { data = true; }
rows.forEach(function(item){
if( item.getCell('oper_new').getValue() == data ) { return }
if( item.getData().document_type != 'Usage' ) { return }
ajax_query( "PUT", "/api/operations/Document/" +item.getData().id, { oper_new: data },{
async : false,
success: function( data ) {
item.update( data );
}
});
});
});
When I press button I requests are made to server. I stop page and want to reload it. I go to address bar and press enter
Actual results:
The page is reloaded but old queries from foreach loop continue to work
Expected results:
Script code which is run from old page (different page) should be stopped, killed and cleared.
When I input new url into address bar (despite on it is equal to old it is new, because I just input it into address bar) I do not expect side effect from old requests.
This page MUST BE completely new.
Probably here is security issue. If one site makes closure with big timeout, 10min.
This timeout is kept in this tab. For this time user could gone from initial page to some different. And when time tick is come the code from different page is executed.
| Reporter | ||
Comment 1•5 years ago
|
||
I mean old code is executed on new page
| Reporter | ||
Comment 2•5 years ago
|
||
Comment 3•5 years ago
|
||
Olli, is this something you can look at?
Comment 4•5 years ago
|
||
Eugen, could you perhaps attach a minimal testcase using 'Attach new file'?
Updated•5 years ago
|
| Reporter | ||
Updated•5 years ago
|
Updated•2 years ago
|
Description
•