1

I want to open my print screen option in a new tab instead of a new window.

Here is my javascript code

$scope.PrintWindow = function(divName,method) {
  var printContents = document.getElementById(divName).innerHTML;
  var popupWin = window.open('Print', method, 'fullscreen=yes');
  popupWin.document.open()
  popupWin.document.write('<html><head><link href="print.css" rel="stylesheet" type="text/css" media="print"></head><body onload="window.print()">' + printContents + '</html>');

  popupWin.document.close();
           popupWin.focus();
} 

_self opens in same window

_target and _newtab opens in new window. I want it to be in new tab.

Alaksandar Jesus Gene
  • 6,523
  • 12
  • 52
  • 83

1 Answers1

2

Removed fullscreen=yes and it solved my problem.

  $scope.PrintWindow = function(divName,method) {
      var printContents = document.getElementById(divName).innerHTML;
      var popupWin = window.open('Print', method,);
      popupWin.document.open()
      popupWin.document.write('<html><head><link href="print.css" rel="stylesheet" type="text/css" media="print"></head><body onload="window.print()">' + printContents + '</html>');

      popupWin.document.close();
               popupWin.focus();
    } 
Alaksandar Jesus Gene
  • 6,523
  • 12
  • 52
  • 83