If a WebKitWebSettings "javascript-can-open-windows-automatically" property is disabled, the change will take place immediately, however, when enabling the setting again, pages seems to require a refresh before the setting change takes effect. Tested with WebKitGtk 2.0.2 on OpenBSD (installed from OpenBSD packages).
I forgot to mention this is using the WebKit1 API.