mirror of
https://github.com/internetarchive/brozzler.git
synced 2025-04-20 23:56:34 -04:00
add pop urls using regex for better match
This commit is contained in:
parent
5b393837b8
commit
6431f4e803
@ -1,6 +1,7 @@
|
||||
// we have problems if the page has changed the definition of Set or Array
|
||||
// http://www.polyvore.com/ does this for example
|
||||
var __brzl_framesDone = new Set();
|
||||
var __brzl_popup_re = /window.open\(.*?(['"])(http.*?)\1,/
|
||||
var __brzl_compileOutlinks = function(frame) {
|
||||
__brzl_framesDone.add(frame);
|
||||
var outlinks = [];
|
||||
@ -12,7 +13,8 @@ var __brzl_compileOutlinks = function(frame) {
|
||||
frame.document.querySelectorAll('a[onclick]'));
|
||||
if (popups && popups.length > 0) {
|
||||
for (var p=0; p < popups.length; p++) {
|
||||
popups[p] = popups[p].onclick.toString().split("'")[1];
|
||||
m = popups[p].onclick.toString().match(__brzl_popup_re);
|
||||
popups[p] = m[2];
|
||||
}
|
||||
outlinks = outlinks.concat(popups);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user