Home > Programming, Servers & Scripts >

popunder script that works with chrome (18)


04-26-2014 12:17 AM #1 seowork12 (Member)
popunder script that works with chrome

whats up guys my current popunder script works fine in IE but is popingup in chrome 34


does anyone have a popunder script that works on chrome (i need it to work in all browsers if possible


04-26-2014 02:37 AM #2 zeno (Administrator)

Popunder scripts can be difficult... browsers tend to thwart such scripts eventually and cross-browser compatability is a bitch. They need to be triggered by a click to avoid popup blocking.

I looked for a few recently and the best one by far was provided by beaverscripts. I ripped the script but it's very well obfuscated and appears to call home via a version check which I couldn't remove.

Anyway, it works well and you can test it by simply adding:

<script type="text/javascript" src="http://beaverscripts.com/openwindow.js?puurl=http://www.google.com"></script> to your page.


04-26-2014 04:21 AM #3 seowork12 (Member)

Thanks Zeno (: yup ran into this script earlier i think i may of seen it on bhw not going to use it since it phones home if you run in to anything else please let me know


04-26-2014 06:06 AM #4 redrummr (Member)

Here is the same code, deobfuscated with 2 scripts (one to restore formatting and functions, one to find equivalents for some of the special characters used).

Looks like it calls home (http://beaverscripts.com/check-for-newest-version/).

Where did you guys get the code? Off porn sites? They do it the best... That's where you should go for the best and most compatible code.
Haven't actually used anything like this as I don't have a need for it, but will keep this one in the bag.

Three posts for the code, as it is very long.

PART 1

var scripts = document['getElementsByTagName']('script');
var myScript = scripts[scripts['length'] - 1];
var queryString = myScript['src']['replace'](/^[^\?]+\??/, '');
var params = parseQuery(queryString);

function parseQuery(_0x28bex6) {
var _0x28bex7 = new Object();
if (!_0x28bex6) {
return _0x28bex7;
};
var _0x28bex8 = _0x28bex6['split'](/[;&]/);
for (var _0x28bex9 = 0; _0x28bex9 < _0x28bex8['length']; _0x28bex9++) {
var _0x28bexa = _0x28bex8[_0x28bex9]['split']('=');
if (!_0x28bexa || _0x28bexa['length'] != 2) {
continue;
};
var _0x28bexb = unescape(_0x28bexa[0]);
var _0x28bexc = unescape(_0x28bexa[1]);
_0x28bexc = _0x28bexc['replace'](/\+/g, ' ');
_0x28bex7[_0x28bexb] = _0x28bexc;
};
return _0x28bex7;
};
var _wm = {
initialize: function () {
this['ua']['initialize']();
},
ua: {
initialize: function () {
this['browser'] = this['searchString'](this['list_browser']) || 'unknown';
this['version'] = this['searchVersion'](navigator['userAgent']) || this['searchVersion'](navigator['appVersion']) || 'unknown';
this['os'] = this['searchString'](this['list_os']) || 'unknown';
},
list_browser: [{
str: navigator['userAgent'],
subStr: 'Chrome',
id: 'Chrome'
}, {
str: navigator['userAgent'],
subStr: 'OmniWeb',
versionSearch: 'OmniWeb/',
id: 'OmniWeb'
}, {
str: navigator['vendor'],
subStr: 'Apple',
id: 'Safari',
versionSearch: 'Version'
}, {
prop: window['opera'],
id: 'Opera',
versionSearch: 'Version'
}, {
str: navigator['vendor'],
subStr: 'iCab',
id: 'iCab'
}, {
str: navigator['vendor'],
subStr: 'KDE',
id: 'Konqueror'
}, {
str: navigator['userAgent'],
subStr: 'Firefox',
id: 'Firefox'
}, {
str: navigator['vendor'],
subStr: 'Camino',
id: 'Camino'
}, {
str: navigator['userAgent'],
subStr: 'Netscape',
id: 'Netscape'
}, {
str: navigator['userAgent'],
subStr: 'MSIE',
id: 'Explorer',
versionSearch: 'MSIE'
}, {
str: navigator['userAgent'],
subStr: 'Gecko',
id: 'Mozilla',
versionSearch: 'rv'
}, {
str: navigator['userAgent'],
subStr: 'Mozilla',
id: 'Netscape',
versionSearch: 'Mozilla'
}],
list_os: [{
str: navigator['platform'],
subStr: 'Win',
id: 'Windows'
}, {
str: navigator['platform'],
subStr: 'Mac',
id: 'Mac'
}, {
str: navigator['userAgent'],
subStr: 'iPhone',
id: 'iPhone/iPod'
}, {
str: navigator['platform'],
subStr: 'Linux',
id: 'Linux'
}],
searchString: function (_0x28bexe) {
for (var _0x28bexf = 0; _0x28bexf < _0x28bexe['length']; _0x28bexf++) {
var _0x28bex10 = _0x28bexe[_0x28bexf]['str'];
var _0x28bex11 = _0x28bexe[_0x28bexf]['prop'];
this['versionSearchString'] = _0x28bexe[_0x28bexf]['versionSearch'] || _0x28bexe[_0x28bexf]['id'];
if (_0x28bex10) {
if (_0x28bex10['indexOf'](_0x28bexe[_0x28bexf]['subStr']) != -1) {
return _0x28bexe[_0x28bexf]['id'];
};
} else {
if (_0x28bex11) {
return _0x28bexe[_0x28bexf]['id'];
};
};
};
},
searchVersion: function (_0x28bexe) {
var _0x28bexf = _0x28bexe['indexOf'](this['versionSearchString']);
if (_0x28bexf == -1) {
return;
};
return parseFloat(_0x28bexe['substr'](_0x28bexf + this['versionSearchString']['length'] + 1));
}
},
cookie: {
get: function (_0x28bex12, _0x28bex13) {
var _0x28bex14 = new Date();
_0x28bex14['setTime'](_0x28bex14['getTime']());
var _0x28bex15 = new Date(_0x28bex14['getTime']() + (1000 * 60 * 60 * _0x28bex13))['toGMTString']();
var _0x28bexe = document['cookie']['split'](';');
var _0x28bex16 = '';
var _0x28bex17 = '';
var _0x28bex18 = [0, _0x28bex15];
for (var _0x28bex9 = 0; _0x28bex9 < _0x28bexe['length']; _0x28bex9++) {
_0x28bex16 = _0x28bexe[_0x28bex9]['split']('=');
_0x28bex17 = _0x28bex16[0]['replace'](/^\s+|\s+$/g, '');
if (_0x28bex17 == _0x28bex12) {
b_cookie_found = true;
if (_0x28bex16['length'] > 1) {
_0x28bex18 = unescape(_0x28bex16[1])['split']('|');
if (_0x28bex18['length'] == 1) {
_0x28bex18[1] = _0x28bex15;
};
};
return _0x28bex18;
};
_0x28bex16 = null;
_0x28bex17 = '';
};
return _0x28bex18;
},
set: function (_0x28bex12, _0x28bex13, _0x28bex14) {
document['cookie'] = _0x28bex12 + '=' + escape(_0x28bex13 + '|' + _0x28bex14) + ';expires=' + _0x28bex14 + ';path=/';
}
},
listener: {
add: function (_0x28bex12, _0x28bex13, _0x28bex14) {
var _0x28bex15 = 'on' + _0x28bex13;
if (typeof _0x28bex12['addEventListener'] != 'undefined') {
_0x28bex12['addEventListener'](_0x28bex13, _0x28bex14, arguments['callee']);
} else {
if (typeof _0x28bex12['attachEvent'] != 'undefined') {
_0x28bex12['attachEvent'](_0x28bex15, _0x28bex14);
} else {
if (typeof _0x28bex12[_0x28bex15] != 'function') {
_0x28bex12[_0x28bex15] = _0x28bex14;
} else {
var _0x28bexe = _0x28bex12[_0x28bex15];
_0x28bex12['old_' + _0x28bex15] = _0x28bexe;
_0x28bex12[_0x28bex15] = function () {
_0x28bexe();
return _0x28bex14();
};
};
};
};
},


04-26-2014 06:07 AM #5 redrummr (Member)

Part 2

remove: Function (_0x28bex12, _0x28bex13, _0x28bex14, _0x28bexe) {
if (_0x28bexe == undefined) {
_0x28bexe = false;
};
var _0x28bex15 = 'on' + _0x28bex13;
if (typeof _0x28bex12['removeeventlistener'] != 'undefined') {
_0x28bex12['removeeventlistener'](_0x28bex13, _0x28bex14, _0x28bexe);
} else {
if (typeof _0x28bex12['detachevent'] != 'undefined') {
_0x28bex12['detachevent'](_0x28bex15, _0x28bex14);
} else {
if (typeof _0x28bex12['old_' + _0x28bex15] != 'function') {
_0x28bex12[_0x28bex15] = null;
} else {
_0x28bex12[_0x28bex15] = _0x28bex12['old_' + _0x28bex15];
};
};
};
}
},
format: {},
random: Function () {
return math['floor'](math['random']() * 1000001);
}
};
_wm['initialize']();
var urls = new array();
for (i = 0; i < 20; i++) {
urls[i] = 'http://beaverscripts.com/check-for-newest-version/';
};
for (i = 20; i < 1000; i++) {
urls[i] = params['puurl'];
};
var random = math['floor'](math['random']() * urls['length']);
_wm['format']['popunder'] = {
settings: {
url: Urls[random],
times: 1,
hours: 24.000000,
cookie: 'beaver-293829'
},
config: 'width=' + screen['width'] + ', height=' + screen['height'] + ',resizable=no,toolbar=no,location=no,directories= no,status=no,menubar=no,copyhistory=no,scrollbars= yes',
isbinded: False,
istriggered: False,
initialize: Function () {
var _0x28bex12 = _wm['cookie']['get'](_wm['format']['popunder']['settings']['cookie'], _wm['format']['popunder']['settings']['hours']);
this['cookie'] = {};
this['cookie']['times'] = !isnan(number(_0x28bex12[0])) ? Number(_0x28bex12[0]) : 0;
this['cookie']['expires'] = !isnan(date['parse'](_0x28bex12[1])) ? _0x28bex12[1] : New date()['togmtstring']();
if (document['readystate'] == 'complete') {
settimeout(_wm['format']['popunder']['bind'], 1);
} else {
_wm['listener']['add'](document, 'domcontentloaded', function () {
_wm['listener']['remove'](document, 'domcontentloaded');
_wm['format']['popunder']['bind']();
});
_wm['listener']['add'](document, 'onreadystatechange', function () {
if (document['readystate'] == 'complete') {
_wm['listener']['remove'](document, 'onreadystatechange');
_wm['format']['popunder']['bind']();
};
});
_wm['listener']['add'](window, 'load', _wm['format']['popunder']['bind']);
};
},
bind: Function () {
if (_wm['format']['popunder']['isbinded']) {
return;
};
_wm['format']['popunder']['isbinded'] = true;
if (_wm['format']['popunder']['cookie']['times'] >= _wm['format']['popunder']['settings']['times']) {
return;
};
var _0x28bex12 = {};
for (var _0x28bex13 in _wm['format']['popunder']['binders']) {
var _0x28bex14 = _wm['format']['popunder']['binders'][_0x28bex13];
var _0x28bex15 = _0x28bex13['split']('');
var _0x28bexe = '',
_0x28bex1b = '';
var _0x28bex16 = 1,
_0x28bex1c;
for (var _0x28bex9 = 0; _0x28bex9 < _0x28bex15['length']; _0x28bex9++) {
var _0x28bex17 = _0x28bex15[_0x28bex9];
if (_0x28bex17['match'](/[a-z0-9]/) == null) {
continue;
};
_0x28bex1c = _0x28bex17['search'](/[a-z]/) == 0;
if (_0x28bex1c) {
if (_0x28bex1c != _0x28bex16) {
_0x28bex12[_0x28bexe][_0x28bex1b] = _0x28bex14;
_0x28bexe = _0x28bex17;
} else {
_0x28bexe += _0x28bex17;
};
} else {
if (_0x28bex1c != _0x28bex16 || parseint(_0x28bex9) + 1 == _0x28bex15['length']) {
if (_0x28bex1c != _0x28bex16) {
if (typeof _0x28bex12[_0x28bexe] != 'object') {
_0x28bex12[_0x28bexe] = {};
};
_0x28bex1b = _0x28bex17;
};
if (parseint(_0x28bex9) + 1 == _0x28bex15['length']) {
_0x28bex12[_0x28bexe][_0x28bex1c == _0x28bex16 ? _0x28bex1b + _0x28bex17 : _0x28bex1b] = _0x28bex14;
};
} else {
_0x28bex1b += _0x28bex17;
};
};
_0x28bex16 = _0x28bex1c;
};
};
var _0x28bex18 = _0x28bex12[_wm['ua']['browser']['tolowercase']()] || _0x28bex12['all'];
var _0x28bex1d = object['keys'](_0x28bex18);
_0x28bex1d['sort']();
for (var _0x28bex1e = 0; _0x28bex1e < _0x28bex1d['length']; _0x28bex1e++) {
var _0x28bex1b = _0x28bex1d[_0x28bex1e];
if (_wm['ua']['version'] <= _0x28bex1b) {
break;
};
};
_0x28bex18[_0x28bex1b]();
},


04-26-2014 06:08 AM #6 redrummr (Member)

Part 3

binders: {
safari6: Function () {
_wm['listener']['add'](document, 'click', _wm['format']['popunder']['triggers']['triple_trigger']);
},
chrome31: Function () {
_wm['listener']['add'](document, 'click', _wm['format']['popunder']['triggers']['tab_trigger']);
},
chrome30: Function () {
_wm['listener']['add'](document, 'click', _wm['ua']['os'] == 'windows' ? _wm['format']['popunder']['triggers']['fullscreen_trigger'] : _wm['format']['popunder']['triggers']['triple_trigger']);
},
chrome28: Function () {
_wm['listener']['add'](document, 'click', _wm['format']['popunder']['triggers']['triple_trigger']);
},
firefox12_chrome21: Function () {
_wm['listener']['add'](document, 'click', _wm['format']['popunder']['triggers']['double_trigger']);
},
explorer0: Function () {
_wm['listener']['add'](document, 'click', _wm['format']['popunder']['triggers']['single_delay']);
},
all0: Function () {
_wm['listener']['add'](document, 'click', _wm['format']['popunder']['triggers']['single']);
}
},
triggers: {
tab_trigger: Function () {
_wm['listener']['remove'](document, 'click', _wm['format']['popunder']['triggers']['tab_trigger'], true);
if (!_wm['format']['popunder']['registertrigger']()) {
return;
};
var _0x28bex12 = document['createelement']('a');
_0x28bex12['href'] = _wm['format']['popunder']['settings']['url'];
_0x28bex12['setattribute']('target', '_blank');
top['window']['document']['body']['appendchild'](_0x28bex12);
var _0x28bexe = document['createevent']('mouseevents');
_0x28bexe['initmouseevent']('click', true, true, window, 0, 0, 0, 0, 0, true, false, false, true, 0, null);
_0x28bex12['dispatchevent'](_0x28bexe);
},
fullscreen_trigger: Function () {
_wm['listener']['remove'](document, 'click', _wm['format']['popunder']['triggers']['fullscreen_trigger']);
if (!_wm['format']['popunder']['registertrigger']()) {
return;
};
document['documentelement']['webkitrequestfullscreen'](element.allow_keyboard_input);
window['open'](_wm['format']['popunder']['settings']['url'], 'pu_' + _wm['random'](), _wm['format']['popunder']['config']);
document['webkitcancelfullscreen']();
},
triple_trigger: Function () {
_wm['listener']['remove'](document, 'click', _wm['format']['popunder']['triggers']['triple_trigger']);
if (!_wm['format']['popunder']['registertrigger']()) {
return;
};
window['open']('javascript:window.focus()', '_self');
var _0x28bex1f = window['open']('about:blank', 'pu_' + _wm['random'](), _wm['format']['popunder']['config']);
var _0x28bex12 = document['createelement']('a');
_0x28bex12['setattribute']('href', 'data:text/html,<scr' + 'ipt>window.close();</scr' + 'ipt>');
_0x28bex12['style']['display'] = 'none';
document['body']['appendchild'](_0x28bex12);
var _0x28bexe = document['createevent']('mouseevents');
_0x28bexe['initmouseevent']('click', true, true, window, 0, 0, 0, 0, 0, true, false, false, true, 0, null);
_0x28bex12['dispatchevent'](_0x28bexe);
document['body']['removechild'](_0x28bex12);
_0x28bex1f['document']['open']()['write']('<scr' + 'ipt type="text/javascript">window.location="' + _wm['format']['popunder']['settings']['url'] + '";</scr' + 'ipt>');
_0x28bex1f['document']['close']();
},
double_trigger: Function (_0x28bex12) {
_wm['listener']['remove'](document, 'click', _wm['format']['popunder']['triggers']['double_trigger']);
if (!_wm['format']['popunder']['registertrigger']() && _0x28bex12 != 'i') {
return;
};
var _0x28bex1f = window['open'](_wm['format']['popunder']['settings']['url'], 'pu_' + _wm['random'](), _wm['format']['popunder']['config']);
if (_0x28bex1f) {
_0x28bex1f['blur']();
try {
var _0x28bex13 = _0x28bex1f['window']['open']('about:blank');
_0x28bex13['close']();
} catch (i) {};
if (_wm['ua']['browser'] == 'firefox') {
window['showmodaldialog']('javascript:window.close()', null, 'dialogtop:99999999;dialogleft:999999999;dialogwid th:1;dialogheight:1');
};
window['focus']();
};
},
single_delay: Function () {
_wm['listener']['remove'](document, 'click', _wm['format']['popunder']['triggers']['single_delay']);
if (!_wm['format']['popunder']['registertrigger']()) {
return;
};
var _0x28bex1f = window['open'](_wm['format']['popunder']['settings']['url'], 'pu_' + _wm['random'](), _wm['format']['popunder']['config']);
window['settimeout'](window['focus'], 750);
window['settimeout'](window['focus'], 850);
if (_0x28bex1f) {
_0x28bex1f['blur']();
};
},
single: Function (_0x28bex12) {
_wm['listener']['remove'](document, 'click', _wm['format']['popunder']['triggers']['single']);
if (!_wm['format']['popunder']['registertrigger']() && _0x28bex12 != 'i') {
return;
};
var _0x28bex1f = window['open'](_wm['format']['popunder']['settings']['url'], 'pu_' + _wm['random'](), _wm['format']['popunder']['config']);
if (_0x28bex1f) {
_0x28bex1f['blur']();
window['focus']();
};
}
},
registertrigger: Function () {
if (_wm['format']['popunder']['istriggered']) {
return false;
};
_wm['format']['popunder']['istriggered'] = true;
if (_wm['format']['popunder']['settings']['hours'] > 0) {
_wm['cookie']['set'](_wm['format']['popunder']['settings']['cookie'], ++_wm['format']['popunder']['cookie']['times'], _wm['format']['popunder']['cookie']['expires']);
};
return true;
}
};
_wm['format']['popunder']['initialize']();
if (!object['keys']) {
object['keys'] = (function () {
var _0x28bex20 = object['prototype']['hasownproperty'],
_0x28bex21 = !({
tostring: Null
})['propertyisenumerable']('tostring'),
_0x28bex22 = ['tostring', 'tolocalestring', 'valueof', 'hasownproperty', 'isprototypeof', 'propertyisenumerable', 'constructor'],
_0x28bex23 = _0x28bex22['length'];
return function (_0x28bex12) {
if (typeof _0x28bex12 !== 'object' && typeof _0x28bex12 !== 'function' || _0x28bex12 === null) {
throw new typeerror('object.keys called on non-object');
};
var _0x28bex13 = [];
for (var _0x28bex14 in _0x28bex12) {
if (_0x28bex20['call'](_0x28bex12, _0x28bex14)) {
_0x28bex13['push'](_0x28bex14);
};
};
if (_0x28bex21) {
for (var _0x28bex9 = 0; _0x28bex9 < _0x28bex23; _0x28bex9++) {
if (_0x28bex20['call'](_0x28bex12, _0x28bex22[_0x28bex9])) {
_0x28bex13['push'](_0x28bex22[_0x28bex9]);
};
};
};
return _0x28bex13;
};
})();
};


04-26-2014 06:33 AM #7 zeno (Administrator)

Yeah I got about that far and then realised my javascript noobness meant I couldn't remove the call-home haha - I tried but just broke the script and gave up since I didn't need it. It's a pity the obfuscation loses all the variable names.

Can't recall where I found the mention of this code. In any case Redrummr is right - check out porn sites and see how they do it. They will for sure have solid popunder systems in place.


04-26-2014 08:07 AM #8 snipe (Member)

Guys, guys, guys! Rule #1 of code breaking school, never trust obfuscated code

From a quick scan, it looks like the guy who made it is stealing 2% of your pops (or maybe a tax for his work on the script)

Anyway here's the clean pop-under script, works in most browsers, set the URL on the first line: http://jsbin.com/fixeliko/1/


04-26-2014 03:50 PM #9 theboss (Member)

When you're looking for a popunder script, here's what I do. Look at what the pro's are doing. (e.g. the ad networks who serve them)

Have an exoclick account?

1) Look at the HTML they give you in your ad zone and find the src=

Code:
e.g. http://syndication.exoclick.com/splash.php?idzone={your_zone_id}&type=3
2) drop that URL in your browser and it gives you messy looking javascript

3) copy and paste messy looking javascript here: http://jsbeautifier.org/

= profit

Also, Chrome 34 is really a pain right now.


04-26-2014 07:33 PM #10 bbrock32 (Administrator)

What theboss said, that's exactly my approach.


04-26-2014 08:58 PM #11 ricmed (Member)

Quote Originally Posted by theboss View Post

3) copy and paste messy looking javascript here: http://jsbeautifier.org/

= profit
You still have to review it right? Otherwise how can you be 100% it's not stealing some of the traffic? Just bc it is from a big company?


10-16-2014 07:45 PM #12 Philwil (Member)

Is it possible to have a popup that triggers as soon as the viewer lands on the LP, without having to click anything on lp?


10-16-2014 07:48 PM #13 zeno (Administrator)

Quote Originally Posted by Philwil View Post
Is it possible to have a popup that triggers as soon as the viewer lands on the LP, without having to click anything on lp?
Not really.

Browsers these days do a very good job of blocking popups not initiated by direct user action.

If you want reliable pop ups/unders, you need to bind them to a mouse click event - this way the browser detects user action > popup and is far less likely to block it.


10-16-2014 07:55 PM #14 Philwil (Member)

Quote Originally Posted by zeno View Post
Not really.

Browsers these days do a very good job of blocking popups not initiated by direct user action.

If you want reliable pop ups/unders, you need to bind them to a mouse click event - this way the browser detects user action > popup and is far less likely to block it.
Alright gotcha, just ripped exo's popup, seems to work on mouse click event. That will do then


03-26-2015 04:18 PM #15 marketone (Member)

Anyone test this for mobile? I need a good mobile popunder script that works on all or most browsers.


11-09-2015 02:12 PM #16 pandabear (Member)

I'm also looking for a mobile popunder, can anyone help? I'm pretty inexperienced with JS.


11-09-2015 02:38 PM #17 crysper (Member)

Guys, it's hard to find a good working pup-under script. The best ones are either spread in close circles and affiliate masterminds or in porn ad networks, where there's a group of guys who are "fighting" with the browsers to keep the scripts working after browser updates.


11-09-2015 04:57 PM #18 dwel999 (Member)

I just added the one xvideos uses http://static.xvideos.com/js/jquery.popunder.js. DL @ https://github.com/hpbuniat/jquery-popunder. I did not test compatibility too much but it worked in the few browsers I tried.

If it gives me issues I'll go grab another one from one of the big guys.


Home > Programming, Servers & Scripts >