Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webrowser settings UseJavaScript=false change to UseJavaScript =true when opening new webbrwser #49

Open
GoogleCodeExporter opened this issue Jul 7, 2015 · 5 comments

Comments

@GoogleCodeExporter
Copy link

lets say i want one webrowser to not use javascript so i use 
UseJavaScript=false then open new tab with new webbrowser i check the first one 
and UseJavaScript is now true because i open new webbrowser
thats a bug

Original issue reported on code.google.com by meirb...@gmail.com on 9 Dec 2011 at 2:14

@GoogleCodeExporter
Copy link
Author

That's true. What I suggest is create a class which represents the 
WebKitBrowser object and add a property called PrivateScriptingEnabled 
(boolean). Then set that property to the value you want and add a handler to 
TabChanged event and detect if that value is set to true then also set 
UseJavascript to true and the opposite. Code example:

public class MyBrowser : WebKit.WebKitBrowser
{
    public bool PrivateScriptingEnabled { get; set; }
}

private void TabChanged(...)
{ 
    br = ((MyBrowser)currenttab.Controls[0]);
    br.UseJavaScript = br.PrivateScriptingEnabled;
}

This has to be done because by changing the UseJavaScript property the 
preferences of the whole engine change.

Original comment by tsumalis96@gmail.com on 9 Dec 2011 at 3:27

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

so if UseJavaScript is global to the engine then is should only be in the 
WebKit.GlobalPreferences not per webbrowser Properties .


the above will not work with my problem:

i have an option to auto open a list of address in the same time to diffrent
webbrowsers/tabs  some of the address i need to disable scripting your
example only works with one at a time. 

ie has restricted sites list which disable script  i have used something like 
this
but it only work when opening one at a time and not multi address/tabs

Original comment by meirb...@gmail.com on 9 Dec 2011 at 4:56

@GoogleCodeExporter
Copy link
Author

Then you should change the tabs and reload the browser that is selected every 
time the value is changed.

Original comment by tsumalis96@gmail.com on 9 Dec 2011 at 8:06

@GoogleCodeExporter
Copy link
Author

reloading isn't much of solution, isnt there a way for you to make 
UseJavaScript work
per webbrowser and not global

Original comment by meirb...@gmail.com on 9 Dec 2011 at 9:13

@GoogleCodeExporter
Copy link
Author

WebKit does not provide that functionality, so unless you go into the source of 
WebKit and modify it, it is not possible to do sth like that. Unfortunately I 
am not able to change the source of WebKit since I don't have the knowledge. I 
only read it to implement features to OWS, I cannot build my own build.

Original comment by tsumalis96@gmail.com on 10 Dec 2011 at 4:07

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant