var w = window.open()

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
Vegan
Forum Regular
Posts: 574
Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC
Contact:

var w = window.open()

Post by Vegan »

So instead of a javscript alter to pester adblocker users, I was wondering if opening a window with a message and and link would substitute

eg

var w = windows.open()

// document.write some HTML
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: var w = window.open()

Post by requinix »

...What?
Eric!
DevNet Resident
Posts: 1146
Joined: Sun Jun 14, 2009 3:13 pm

Re: var w = window.open()

Post by Eric! »

I think he is talking about those javascripts that detect adblocker because the browser doesn't request an image. They often will alter the DOM somewhere to say "hey we need ads to pay for this site! Turn off your fricken adblocker". I think Vegan wants to basically make that a pop-up but with a new tab. But I didn't really see a question in there.
User avatar
Vegan
Forum Regular
Posts: 574
Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC
Contact:

Re: var w = window.open()

Post by Vegan »

i use a js file with one line

Code: Select all

document.write('<div id="tester">an advertisement</div>');
then I include it

Code: Select all

<script src="http://hardcore-games.azurewebsites.net/js/advertisement.js" type="text/javascript"></script>
then I can detect the ad blocker by checking in the menu

Code: Select all

<script type="text/javascript">
	if (document.getElementById("tester") == undefined) {
		alert("An ad blocker has been detected. Please remove the program to use this site. This is an ad supported small business.");
	}
</script>
So instead I was thinking of using a window with a nag to disable the blocker along with maybe a option to subscribe

so the idea popped up so to speak
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: var w = window.open()

Post by requinix »

If they have ads blocked then they probably have popups blocked too.
Eric!
DevNet Resident
Posts: 1146
Joined: Sun Jun 14, 2009 3:13 pm

Re: var w = window.open()

Post by Eric! »

I've never tested it properly but I know that pop-ups get blocked, however sometimes new tabs don't. Maybe it has to do with the way the requested window is configured to open?
User avatar
Vegan
Forum Regular
Posts: 574
Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC
Contact:

Re: var w = window.open()

Post by Vegan »

its a problem and I thought I would come here in the hope of finding solutions, after all the jerk who distributes the ad blocker is on my radar for extradition to face a raft of infringement charges that would leave him incarcerated for at least a millenia or 5

maybe I should make an example of him, I have the capacity and the ability and I practice law
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
Eric!
DevNet Resident
Posts: 1146
Joined: Sun Jun 14, 2009 3:13 pm

Re: var w = window.open()

Post by Eric! »

I don't want to get into the Ad Blocker debate.

The most common method is when you detect ad blocker is to change the DOM to present a begging/nagging message there on the space where the blank ad divs show up. For noscript users you just have to redirect them with a meta refresh tag.
User avatar
Vincent Puglia
Forum Commoner
Posts: 67
Joined: Thu Sep 04, 2003 4:20 pm
Location: where the World once stood

Re: var w = window.open()

Post by Vincent Puglia »

@vegan,
I keep my blocker up and for every site that I've run across that circumvents it, I have one less site that I visit. There are enough sites on the web offering the same material, that I don't need to deal with pop-ups, pop-unders, and scrolling divs that cover what I'm reading. If the ads stayed within a given area (right column, eg) fine, but I'm not going to be intimidated/tricked into clicking them (which is what many do)
User avatar
Vegan
Forum Regular
Posts: 574
Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC
Contact:

Re: var w = window.open()

Post by Vegan »

I have ads on my pages, but not so much that its hard to read the site. I have put a lot of work into it, and I need to eat too. Using ad-blockers takes the grub off a lot of tables.

:banghead: working on the site

with the defenses I use right now, google does not even crawl the site
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
Eric!
DevNet Resident
Posts: 1146
Joined: Sun Jun 14, 2009 3:13 pm

Re: var w = window.open()

Post by Eric! »

I see you got that code from emoticode. I think it is a bit too strict. Have you tried some of the other open source tools out there or doing a CSS trick (see answers) to ask them to whitelist your site?
User avatar
Vegan
Forum Regular
Posts: 574
Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC
Contact:

Re: var w = window.open()

Post by Vegan »

I am trying some other options, mainly so that google can crawl the site while giving adblock users the bums rush

seems to be outright pervasive now, on my site I estimate 90% or more block my ads etc
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
Post Reply