Firefox V50 - Javascript Popup blocked

Colonel_Black

Honorable
Dec 15, 2012
2
0
10,510
Hi,

Ever since upgrading our Citrix image to FF v 50, we're unable to add documents via our Dynamics website.
When clicking the add document button, it is saying "Popup blocked: *URL*"

When running it in admin mode, it works fine, but It's not reporting any errors/causes as to why it doesn't work for normal uses.
There seems to be no Java/Javascript configurations within the application since the update, whereas the old version did.
Using NoScript addon works, but that isn't a thing we want to use globally. Has anyone had any experience with this or could be of any help please?



--------
This seems to be the code that generates the error.
Code below. The bit i'm looking at is:
alert("Popup blocked: " + window.location.hostname);
What is causing that to happen?

Thanks

------------

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width" />
<title>SP Document View</title>

<script src="Https://dynwebapplive.*RemovedURL*.com:448/Scripts/jquery-2.0.3.min.js"></script>

<script src="Https://dynwebapplive.*RemovedURL*.com:448/Scripts/kendo/2015.3.1111/kendo.web.min.js"></script>

<script src="Https://dynwebapplive.*RemovedURL*.com:448/Scripts/kendo/2015.3.1111/kendo.aspnetmvc.min.js"></script>

<script src="Https://dynwebapplive.*RemovedURL*.com:448/Scripts/kendo/2015.3.1111/kendo.all.min.js"></script>

<script src="Https://dynwebapplive.*RemovedURL*.com:448/Scripts/jvalidate.min.js"></script>

<script src="Https://dynwebapplive.*RemovedURL*.com:448/Scripts/jvalidate.unobtrusive.min.js"></script>

<script src="Https://dynwebapplive.*RemovedURL*.com:448/Scripts/globalize.js"></script>

<script src="Https://dynwebapplive.*RemovedURL*.com:448/Scripts/globalize.culture.en-GB.js"></script>

<script src="Https://dynwebapplive.*RemovedURL*.com:448/Scripts/jvalidate.globalize.min.js"></script>

<script src="Https://dynwebapplive.*RemovedURL*.com:448/Scripts/kendo/2015.3.1111/kendo.validator.min.js"></script>

<script src="Https://dynwebapplive.*RemovedURL*.com:448/Scripts/kendo/2015.3.1111/kendo.culture.en-GB.min.js"></script>

<script src="Https://dynwebapplive.*RemovedURL*.com:448/Scripts/bootstrap.js"></script>

<script src="Https://dynwebapplive.*RemovedURL*.com:448/Scripts/jui-1.10.3.min.js"></script>

<script src="Https://dynwebapplive.*RemovedURL*.com:448/Scripts/kendo.modernizr.custom.js"></script>

<script src="Https://dynwebapplive.*RemovedURL*.com:448/Scripts/jsapi.min.js"></script>


<link href="Https://dynwebapplive.*RemovedURL*.com:448/Content/bootstrap/bootstrap.min.css" rel="stylesheet"/>

<link href="Https://dynwebapplive.*RemovedURL*.com:448/Content/themes/base/minified/jui.min.css" rel="stylesheet"/>

<link href="Https://dynwebapplive.*RemovedURL*.com:448/Content/font-awesome.min.css" rel="stylesheet"/>

<link href="Https://dynwebapplive.*RemovedURL*.com:448/Content/kendo/2015.3.1111/kendo.common.min.css" rel="stylesheet"/>

<link href="Https://dynwebapplive.*RemovedURL*.com:448/Content/kendo/2015.3.1111/kendo.default.min.css" rel="stylesheet"/>

<link href="Https://dynwebapplive.*RemovedURL*.com:448/Content/kendo/2015.3.1111/kendo.dataviz.min.css" rel="stylesheet"/>

<link href="Https://dynwebapplive.*RemovedURL*.com:448/Content/kendo/2015.3.1111/kendo.silver.min.css" rel="stylesheet"/>

<link href="Https://dynwebapplive.*RemovedURL*.com:448/Content/kendo/2015.3.1111/kendo.dataviz.silver.min.css" rel="stylesheet"/>





<script type="text/javascript">
function LoadDocs() {
return {
entityId: $("#EntityId").val(),
entityType: $("#EntityType").val(),
siteURL: $("#SiteUrl").val()
};
}
function DownloadDocument(documentUrl, fileName, location) {
if (location === 'Data centre') {
var siteUrl = $("#SiteUrl").val();
var downloadUrl = siteUrl + "/_layouts/download.aspx?SourceUrl=" + encodeURIComponent(documentUrl);
window.open(downloadUrl);
}
else {
var downloadUrl = "/ExternalPages/Files/Download?id=" + documentUrl + "&fileName=" + fileName;
window.open(downloadUrl);
}
}
function UploadDocument() {
var siteUrl = $("#SiteUrl").val();
var listId = $("#ListId").val();
var entityType = $("#EntityType").val();
var folderServerRelativeUrl = $("#EntityFolder").val();
if (listId !== null && folderServerRelativeUrl !== null) {
var listPath = encodeURIComponent('/' + entityType + '/' + folderServerRelativeUrl);
var uploadPageUrl = siteUrl + "/crmgrid/dialogcontainerpage.aspx?pageType=2&listid=" + listId + "&langId=en-US&RootFolder=" + listPath;
var returnVal = openStdDlg(uploadPageUrl, 700, 500, true);
if (typeof (returnVal) === "undefined" || returnVal === null) {
$('#SPDocumentGrid').data('kendoGrid').dataSource.read();
$('#SPDocumentGrid').data('kendoGrid').refresh();
}
}
else {
alert("Document Storage does not exists!");
}
}
function openStdDlg(url, width, height, resizable) {
width = getAdjustedWidthForScreen(width);
height = getAdjustedHeightForScreen(height);
var left = getLeftMargin(width);
var top = getTopMargin(height);
if (window.LOCID_UI_DIR === 'RTL') {
left = window.screen.availWidth - left - width;
}
var customWinParams = 'dialogWidth:' + width + 'px;dialogHeight:' + height + 'px;dialogLeft:' + left + 'px;dialogTop:' + top + 'px;help:0;status:1;scroll:0;center:1;resizable:' + ((resizable) ? 'yes' : 'no') + ';' + customWinParams;
var arguments = new Object();
var returnVar = null;
try {
do {
returnVar = window.showModalDialog(url, arguments, customWinParams);
} while (returnVar === '___RETRY___');
}
catch ($e1) {
alert("Popup blocked: " + window.location.hostname);
}
return returnVar;
}
function getAdjustedWidthForScreen(x) {
var originalWidth = x;
if (!x) {
x = (window.screen.availWidth >= 1000) ? 820 : 750;
}
x = (x >= window.screen.availWidth) ? window.screen.availWidth : x;
return x;
}
function getAdjustedHeightForScreen(y) {
if (!y) {
return (window.screen.availHeight >= 600) ? 560 : 510;
}
else {
return (y >= window.screen.availHeight) ? window.screen.availHeight : y;
}
}
function getLeftMargin(x) {
var left = 0;
if ((window.screen.availWidth - x) > 0) {
left = (window.screen.availWidth - x) / 2;
}
return left;
}
function getTopMargin(y) {
var top = 0;
if ((window.screen.availHeight - y) > 0) {
top = (window.screen.availHeight - y) / 2;
}
return top;
}
function fnover() {
var path = $('#DynCrmUrl').val() + "/_imgs/grid/add_hover_13.png";
$('#addSPDocumentImg').attr('src', path);
}

function fnout() {
var path = $('#DynCrmUrl').val() + "/_imgs/grid/Add_13.png";
$('#addSPDocumentImg').attr('src', path);
}
function resizeGrid() {
var gridElement = $("#SPDocumentGrid"),
dataArea = gridElement.find(".k-grid-content"),
gridHeight = Math.min(document.documentElement.clientHeight, $(window).innerHeight() || 0) - 0.5,
otherElements = gridElement.children().not(".k-grid-content"),
otherElementsHeight = 0;
otherElements.each(function () {
otherElementsHeight += $(this).outerHeight();
});
dataArea.height(gridHeight - otherElementsHeight);
}
$(document).ready(function () {
Globalize.culture('en-GB');
kendo.culture('en-GB');
});
</script>
<style>
/*headers*/
.k-block, .k-button, .k-textbox, .k-drag-clue, .k-touch-scrollbar, .k-window, .k-window-titleless .k-window-content, .k-window-action, .k-inline-block, .k-grid .k-filter-options, .k-grouping-header .k-group-indicator, .k-autocomplete, .k-multiselect, .k-combobox, .k-dropdown, .k-dropdown-wrap, .k-datepicker, .k-timepicker, .k-colorpicker, .k-datetimepicker, .k-numerictextbox, .k-picker-wrap, .k-numeric-wrap, .k-list-container.k-colorpicker, .k-calendar-container, .k-calendar td, .k-calendar .k-link, .k-treeview .k-in, .k-editor-inline, .k-tooltip, .k-tile, .k-slider-track, .k-slider-selection, .k-upload {
-moz-border-radius: 0px !important;
-webkit-border-radius: 0px !important;
border-radius: 0px !important;
}
.k-widget, .k-block, .k-inline-block, .k-draghandle {
border-style:none;
border-width:0px;
}
.k-grid-toolbar {
background-color: transparent;
border-top:none;
border-right:none;
border-left:none;
text-align:right;
height:20px;
}
.k-toolbarbutton {
width: 16px;
height: 16px;
margin-right: 4px;
margin-bottom: 4px;
}
.k-grid {
font-family:Segoe UI,Tahoma,Arial;
font-size: 12px;
}
.k-grid th.k-header,
.k-grid-header
{
background:#ffffff;
color: #000000;
}
.k-grid-header .k-header .k-link
{
min-height:12px;
line-height:12px;
}
.k-grid td
{
border-style:none;
padding: 0.4em 0.4em 0.4em 0.4em;
white-space: nowrap;
}
.k-grid table tr.k-alt {
background: #ffffff;
}
/*Row Selection*/
.k-grid table tr.k-state-selected {
background: #b1d6f0;
color: #000000;
}
.k-grid table tr:hover td {
background: #d7ebf9 !important;
cursor: pointer !important;
}
/* Grid Content (Body) */
.k-grid-content {
min-height: 35px;
}
/*Anchor in Black*/
a, a:hover {
color: #000000;
}
#content {
margin-right:3px;
}
body {
margin:0;
padding:0;
overflow:scroll;
}
</style>
</head>
<body>
<section id="content">
<form action="/ExternalPages/SPDocumentView" method="post"><input id="SiteUrl" name="SiteUrl" type="hidden" value="https://mscrmdocumentcentre.*RemovedURL*.com" /><input data-val="true" data-val-required="The EntityId field is required." id="EntityId" name="EntityId" type="hidden" value="EE3C53AF-DF83-E611-B5F8-005056B06060" /><input id="EntityType" name="EntityType" type="hidden" value="account" /><input id="EntityFolder" name="EntityFolder" type="hidden" value="ee3c53af-df83-e611-b5f8-005056b06060" /><input id="ListId" name="ListId" type="hidden" value="1ee00e5e-0eae-4434-adcf-69f64cb8396a" /><input id="DynCrmUrl" name="DynCrmUrl" type="hidden" value="https://dynamics.*RemovedURL*.com" /> <div class="grid-section">
<div class="k-widget k-grid" id="SPDocumentGrid" style="width: 100%; height: 100%;"><div class="k-header k-grid-toolbar k-grid-top"><a class='k-toolbarbutton' onclick='UploadDocument();' href='javascript: void(0);'><img src='https://dynamics.*RemovedURL*.com/_imgs/grid/Add_13.png' id='addSPDocumentImg' alt='' title='Add Document.' onMouseOver='fnover();' onMouseOut='fnout();' /></a></div><div class="k-grid-header"><div class="k-grid-header-wrap"><table><colgroup><col style="width:21px" /><col /><col style="width:80px" /></colgroup><thead class="k-grid-header"><tr><th class="k-header" data-field="Extension" data-index="0" data-title="" scope="col"><span class="k-link">&nbsp;</span></th><th class="k-header" data-field="FileName" data-index="1" data-title="File Name" scope="col"><span class="k-link">File Name</span></th><th class="k-header" data-field="LastModifiedDate" data-index="2" data-title="Last Modified" scope="col"><span class="k-link">Last Modified</span></th></tr></thead></table></div></div><div class="k-grid-content" style="height:200px"><table><colgroup><col style="width:21px" /><col /><col style="width:80px" /></colgroup><tbody><tr class="k-no-data"><td colspan="3"></td></tr></tbody></table></div></div><script>
jQuery(function(){jQuery("#SPDocumentGrid").kendoGrid({"dataBound":resizeGrid,"columns":[{"headerAttributes":{"data-field":"Extension","data-title":""},"width":"21px","template":"\u003cimg src=\u0027#= HomeUrl #/_layouts/images/ic#= Extension #.gif\u0027/\u003e","field":"Extension","encoded":true},{"title":"File Name","headerAttributes":{"data-field":"FileName","data-title":"File Name"},"template":"\u003ca href=\u0027javascript: void(0);\u0027 onclick=\"DownloadDocument(\u0027#= RelativeURL #\u0027, \u0027#= FileName #\u0027 ,\u0027#= Location #\u0027);\"\u003e#= FileName #\u003c/a\u003e","field":"FileName","encoded":true},{"title":"Last Modified","headerAttributes":{"data-field":"LastModifiedDate","data-title":"Last Modified"},"width":"80px","field":"LastModifiedDate","format":"{0:dd/MM/yyyy}","encoded":true}],"selectable":"Single, Row","scrollable":{"height":"200px"},"toolbar":{},"messages":{"noRecords":"No records available."},"dataSource":{"type":(function(){if(kendo.data.transports['aspnetmvc-ajax']){return 'aspnetmvc-ajax';} else{throw new Error('The kendo.aspnetmvc.min.js script is not included.');}})(),"transport":{"read":{"url":"/ExternalPages/ProcessPages/LoadSPDocuments","data":LoadDocs},"prefix":""},"sort":[{"field":"FileName","dir":"asc"}],"schema":{"data":"Data","total":"Total","errors":"Errors","model":{"fields":{"FileName":{"editable":false,"type":"string"},"HomeUrl":{"type":"string"},"RelativeURL":{"type":"string"},"Extension":{"editable":false,"type":"string"},"LastModifiedDate":{"editable":false,"type":"date"},"Location":{"type":"string"},"FileSize":{"type":"number","defaultValue":null}}}}}});});
</script>
</div>
</form> </section>
</body>
</html>

 
Solution
Code:
try {
do {
returnVar = window.showModalDialog(url, arguments, customWinParams);
} while (returnVar === '___RETRY___');
}
catch ($e1) {
alert("Popup blocked: " + window.location.hostname);
}
something blocking the showmodaldialog
run it with f12 developer tool and look at the console for error

rgd1101

Don't
Moderator
Code:
try {
do {
returnVar = window.showModalDialog(url, arguments, customWinParams);
} while (returnVar === '___RETRY___');
}
catch ($e1) {
alert("Popup blocked: " + window.location.hostname);
}
something blocking the showmodaldialog
run it with f12 developer tool and look at the console for error
 
Solution