Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
casperjs
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
947f1baf
...
947f1baffe0b45a1964973e3705048073df43c22
authored
2013-09-27 18:43:58 +0200
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fixes #644 - better handling of deleted page objects
1 parent
effe51a5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
modules/casper.js
modules/casper.js
View file @
947f1ba
...
...
@@ -938,9 +938,16 @@ Casper.prototype.getPageContent = function getPageContent() {
Casper
.
prototype
.
getCurrentUrl
=
function
getCurrentUrl
()
{
"use strict"
;
this
.
checkStarted
();
return
utils
.
decodeUrl
(
this
.
evaluate
(
function
_evaluate
()
{
return
document
.
location
.
href
;
}));
try
{
return
utils
.
decodeUrl
(
this
.
evaluate
(
function
_evaluate
()
{
return
document
.
location
.
href
;
}));
}
catch
(
e
)
{
// most likely the current page object has been "deleted" (think closed popup)
if
(
/deleted QObject/
.
test
(
e
.
message
))
return
""
;
throw
e
;
}
};
/**
...
...
Please
register
or
sign in
to post a comment