mirror of
https://github.com/ariya/phantomjs.git
synced 2024-09-11 04:46:09 +03:00
Adding 'WebPage#close' calls where appropriate in example scripts.
Fixes http://code.google.com/p/phantomjs/issues/detail?id=903
This commit is contained in:
parent
c9f9b5a14b
commit
f61635f2d4
@ -1,11 +1,12 @@
|
||||
# List following and followers from several accounts
|
||||
|
||||
users= [
|
||||
users = [
|
||||
'ariyahidayat'
|
||||
'detronizator'
|
||||
'KDABQt'
|
||||
'lfranchi'
|
||||
'jonleighton'
|
||||
'_jamesgreene'
|
||||
]
|
||||
|
||||
follow = (user, callback) ->
|
||||
@ -16,6 +17,7 @@ follow = (user, callback) ->
|
||||
else
|
||||
data = page.evaluate -> document.querySelector('div.profile td.stat.stat-last div.statnum').innerText;
|
||||
console.log user + ': ' + data
|
||||
page.close()
|
||||
callback.apply()
|
||||
|
||||
process = () ->
|
||||
|
@ -4,7 +4,8 @@ var users = ['ariyahidayat',
|
||||
'detronizator',
|
||||
'KDABQt',
|
||||
'lfranchi',
|
||||
'jonleighton'];
|
||||
'jonleighton',
|
||||
'_jamesgreene'];
|
||||
|
||||
function follow(user, callback) {
|
||||
var page = require('webpage').create();
|
||||
@ -17,6 +18,7 @@ function follow(user, callback) {
|
||||
});
|
||||
console.log(user + ': ' + data);
|
||||
}
|
||||
page.close();
|
||||
callback.apply();
|
||||
});
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ renderUrlToFile = (url, file, callback) ->
|
||||
else
|
||||
page.render file
|
||||
|
||||
delete page
|
||||
page.close()
|
||||
callback url, file
|
||||
|
||||
# Read the passed args
|
||||
|
@ -28,7 +28,7 @@ function renderUrlToFile(url, file, callback) {
|
||||
} else {
|
||||
page.render(file);
|
||||
}
|
||||
delete page;
|
||||
page.close();
|
||||
callback(url, file);
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user