var tabcount = $('#tabs').tabs('tabs ').length; Modify the addTab method as: function addTab(subtitle, url, icon) {
var tabcount = $('#tabs').tabs('tabs').length;
if (tabcount < ;= 5) {
if (!$('#tabs').tabs('exists', subtitle)) {
$('#tabs').tabs('add', {
title: subtitle,
content: createFrame(url),
closable: true,
icon: icon
});
} else {
$('#tabs'). tabs('select', subtitle);
$('#mm-refresh').click();
}
} else {
alert('You have opened too many, please Close unused windows! ');
return false;
}
The maximum number allowed to be opened is 5 (excluding the welcome page). Can be modified as needed