mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-12-03 14:59:57 +00:00
Fix error opening new windows with popup-blocker (#3515)
this prevents errors when a popup blocker blocks opening a new window from within a running TW
This commit is contained in:
parent
3592333cb8
commit
457f03798c
@ -33,8 +33,16 @@ exports.startup = function() {
|
|||||||
height = paramObject.height || "600",
|
height = paramObject.height || "600",
|
||||||
variables = $tw.utils.extend({},paramObject,{currentTiddler: title});
|
variables = $tw.utils.extend({},paramObject,{currentTiddler: title});
|
||||||
// Open the window
|
// Open the window
|
||||||
var srcWindow = window.open("","external-" + title,"scrollbars,width=" + width + ",height=" + height),
|
var srcWindow,
|
||||||
|
srcDocument;
|
||||||
|
// In case that popup blockers deny opening a new window
|
||||||
|
try {
|
||||||
|
srcWindow = window.open("","external-" + title,"scrollbars,width=" + width + ",height=" + height),
|
||||||
srcDocument = srcWindow.document;
|
srcDocument = srcWindow.document;
|
||||||
|
}
|
||||||
|
catch(e) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
windows[title] = srcWindow;
|
windows[title] = srcWindow;
|
||||||
// Check for reopening the same window
|
// Check for reopening the same window
|
||||||
if(srcWindow.haveInitialisedWindow) {
|
if(srcWindow.haveInitialisedWindow) {
|
||||||
|
Loading…
Reference in New Issue
Block a user