-1

I want to ask about how to disable open new tab or open new window in browser when page loaded using javascript or jQuery, or may be there is a plugin should i used. It will used on exam page that the student forbid to browse google or some search engines for finding exam answer. Please give me some suggestions.

Thank you

Samsul Arifin
  • 247
  • 1
  • 6
  • 24
  • 1
    Possible duplicate of [Preventing pages being open in a new tab/window](https://stackoverflow.com/questions/31472065/preventing-pages-being-open-in-a-new-tab-window) – moon Dec 03 '17 at 11:59
  • That would assume that you can take control over the computer/OS via JavaScript which is not possible. – Krisztián Balla Dec 03 '17 at 12:03
  • [Academia: Are there tools to prevent students from cheating on a programming exam administered on computers?](https://academia.stackexchange.com/questions/28819/are-there-tools-to-prevent-students-from-cheating-on-a-programming-exam-administ) – Andreas Dec 03 '17 at 12:09
  • Thank you @JennyO'Reilly for your answer. May be there is another way? – Samsul Arifin Dec 03 '17 at 12:11
  • That's not my point @Andreas thank you for your answer – Samsul Arifin Dec 03 '17 at 12:13
  • And the question is not in the scope of SO because there are thousand other ways to open a website besides clicking a link... – Andreas Dec 03 '17 at 12:14
  • I only need to disable open new tab or new window in browser @Andreas – Samsul Arifin Dec 03 '17 at 12:17

2 Answers2

1

There is no way to prevent opening new tabs of the browser from the browser's page, but it is possible to implement using browser's add-on. You can check tabs API (Firefox, Chrome) for browser's add-on, it contains all necessary methods and events to allow you to control browser's tabs.

You can implement such add-on for both Firefox and Chrome.

Flying
  • 4,422
  • 2
  • 17
  • 25
  • And make sure no other browser is installed and the user cannot install another browser. :-) – Krisztián Balla Dec 03 '17 at 12:04
  • @JennyO'Reilly it is out of scope of the question of course, otherwise we may need to take care about wide range of other possible ways to cheat on exam :) – Flying Dec 03 '17 at 12:06
  • 1
    And there is no shell/powershell/... available, nor anything that can interpret HTML, ... – Andreas Dec 03 '17 at 12:06
  • So i have to install the add on one by one in the computer student? ;D But thank you for the answer @Flying – Samsul Arifin Dec 03 '17 at 12:18
  • @SamsulArifin Yes, you need to develop and install such add-on on all computers, but it is, of course, just one aspect of the task to keep students from cheating. In its whole such task is out of scope of this question and this site in general because it involves a lot of possible vectors. – Flying Dec 03 '17 at 12:20
  • i concern on disable open new tab and new window in browser, not the cheating. i realize that there are many aspect on cheating that can student do, but the point is disable open new tab and new windows in browser when page exam loaded @Flying – Samsul Arifin Dec 03 '17 at 12:23
  • @SamsulArifin This task can be accomplished by simple add-on that will use `tabs` API. Basically you will need to listen for `windows.onCreated`, `tabs.onCreated` and `tabs.onActivated` events and prevent unwanted actions. – Flying Dec 03 '17 at 12:28
0

On what action is your new tab opening? Provide information on that.

  1. If you are using an anchor <a> element, use target="" to change the target of the new page. link

  2. Use an <iframe> to load external links on your page.

  3. Visit the Mozilla's TABS API.
buddhiv
  • 692
  • 1
  • 7
  • 24