How do i stop popup error javascript?

I have a Windows application where I use the WebBrowser control. The WebBrowser shows an html page created dynamically using javascript and xml.

This html page runs a new pop-up window. It works very well. But when I am closing the pop-up window I get the two errors:

  1. It was not possible to set value of property 'CpGetValue' value of object is Null or it isn't defined;
  2. It was not possible to set value of property 'CpSetValue' value of object is Null or it isn't defined.

I looked for these properties but I can't find them. I used the tips to disable JavaScript errors in the WebBrowser but I can't stop this error.

NotMe

86.6k27 gold badges171 silver badges244 bronze badges

asked Feb 28, 2011 at 9:59

4

SLOPPY SOLUTION

If you have access to the html page and you can fix the javascript then do that. Otherwise, you might try the following.

Traverse the DOM of the webbrowser and inject the following javascript to attempt to suppress the errors:

 

See: How to inject Javascript in WebBrowser control?

answered Mar 2, 2011 at 1:34

How do i stop popup error javascript?

Brandon BooneBrandon Boone

15.9k4 gold badges74 silver badges98 bronze badges

I had a problem awhile ago where I was using a WebBrowser control in a C# app and there was a link that created a pop-up window: the pop-up window did not maintain the same session/cookie data, so I ended up having to post the data I needed. It sounds like something like that could be causing problems for you, but there's not enough detail to tell.

answered Apr 22, 2011 at 15:16

tobytoby

8873 gold badges10 silver badges21 bronze badges

Sorry if it's been asked. I've already found several solutions that aren't working. Not sure what I'm doing wrong.

I don't want to disable all javascript, only Javascript alert boxes. The ones that pop up and force you to click OK or X to close them.

I've found user scripts that claim to do this (example: http://userscripts.org/scripts/show/58252 ). I've put chrome on the dev channel, start chrome with the --enable-user-scripts switch, the script shows up as installed.

But I still get the alert boxes.

An example alert box that isn't getting disabled is at http://wordswithfriends.net/ - put in any garbage word into the word validator on the right sidebar. You get a popup telling you it's not a word.

How do i stop popup error javascript?

Judith

6734 silver badges18 bronze badges

asked Jul 31, 2012 at 15:12

0

The only way to disable the alert boxes is to install either an extension or a userscript. The userscript you linked is for Firefox Greasemonkey and will not work on Chrome.

Additionally, the misbehaving page you cite is sneaky and runs that "word validator" in an iframe with code that fires the alert() immediately upon iframe reload.

But here's a userscript that defeats it:

// ==UserScript==
// @name        Wordswithfriends, Block javascript alerts
// @match       http://wordswithfriends.net/*
// @run-at      document-start
// ==/UserScript==

addJS_Node (null, null, overrideSelectNativeJS_Functions);

function overrideSelectNativeJS_Functions () {
    window.alert = function alert (message) {
        console.log (message);
    }
}

function addJS_Node (text, s_URL, funcToRun) {
    var D                                   = document;
    var scriptNode                          = D.createElement ('script');
    scriptNode.type                         = "text/javascript";
    if (text)       scriptNode.textContent  = text;
    if (s_URL)      scriptNode.src          = s_URL;
    if (funcToRun)  scriptNode.textContent  = '(' + funcToRun.toString() + ')()';

    var targ = D.getElementsByTagName ('head')[0] || D.body || D.documentElement;
    targ.appendChild (scriptNode);
}

If you really want to disable ALL alerts() on ALL pages (Not recommended), then delete the // @match line.

answered Jul 31, 2012 at 16:31

Brock AdamsBrock Adams

2,1104 gold badges24 silver badges33 bronze badges

5

There is at least one extension for that in the Chrome Web Store. Works for me, even though it sounds a bit suspect that it has an optional support by ads mode you can disable in its settings page. (I didn't find the setting, but figured it couldn't hurt null routing api.s13.us.)

answered Sep 22, 2016 at 7:23

ecmanautecmanaut

2361 silver badge3 bronze badges

If you are looking for a tool for this and don't want to mess with user scripts - there is nice tool that can handle any annoying popup on a Windows system - ClickOff. You can download it from here. I checked, it works with "Changes you made may not be saved" alert for SharePoint sites.

answered Dec 22, 2016 at 17:05

SerhiySerhiy

4041 gold badge4 silver badges15 bronze badges

2

How do I stop script error pop

How to Fix a Script Error.
Load the web page again. ... .
Update the web browser. ... .
Load other web pages. ... .
Switch to a different web browser. ... .
Load the web page with a different device. ... .
Remove temporary internet files. ... .
Disable plug-ins. ... .
Disable hardware acceleration..

How can I disable JavaScript popups alerts in Chrome?

Open Chrome DevTools. Press Control+Shift+P or Command+Shift+P (Mac) to open the Command Menu. Start typing javascript , select Disable JavaScript, and then press Enter to run the command. JavaScript is now disabled.

How do I fix JavaScript script error?

How to Fix Script Errors.
Add `crossorigin` attribute on the script tag. If you are trying to load a script on your website from a different origin and add the script tag like the one below, the browser will refuse to load the script. ... .
Return Access-Control-Allow-Origin header on the second origin..

How do I stop pop

To disable the pop-up blocker, uncheck the Blocked (recommended) box. To enable pop-ups on specific sites, check Blocked (recommended) and click Add next to Allow and enter the URL(s). CHROME (MAC) By default, Chrome will notify you when a pop-up is blocked and give you an option to see it.