This time I will share jQuery Plugin and tutorial about Check Duplicate Browser Tabs/Windows With jQuery – duplicate.js, hope it will help you in programming stack.
duplicate.js is a tiny, useful, jQuery based duplicate window checker that checks if a browser tab/window is already opened using pure JavaScript.
How to use it:
1. Download and put the JavaScript file duplicate.js
after loading jQuery JavaScript library.
2 |
integrity = "sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" |
3 |
crossorigin = "anonymous" > |
5 |
< script src = "duplicate.js" ></ script > |
2. Do something if the current browser tab/window is duplicate.
01 |
$(document).ready( function () { |
03 |
if (window.IsDuplicate()) { |
06 |
alert( "Window Already Opened in Another TabnPlease Click Ok" ); |
This awesome jQuery plugin is developed by AshrafAliS. For more Advanced Usages, please check the demo page or visit the official website.