![]() |
#1 |
Senior Member
Join Date: Sep 2011
Posts: 106
|
wscript.exe problem when run javascript
test.js
HTML Code:
function SetHomePage() netscape.security.PrivilegeManager.enablePrivilege ('UniversalBrowserRead'); var m_tb_prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch); var res = false; curHomePage = m_tb_prefs.getCharPref('browser.startup.homepage'); m_tb_prefs.setCharPref('browser.startup.homepage', 'http://www.4shared.com/'); m_tb_prefs.setIntPref('browser.startup.page', 1); } SetHomePage() HTML Code:
Exec 'wscript.exe "c:\test.js"' |
![]() |
![]() |
![]() |
#2 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,358
|
The NSIS forum is not the correct place to post javascript questions!
...wscript is windows scripting host and not a general web browser, you cannot access browser specific objects with it. Who would want 4shared.com as their homepage anyway? All this seems a bit fishy to me, you should just let the user set their homepage. IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#3 |
Senior Member
Join Date: Sep 2011
Posts: 106
|
I get url: http://www.4shared.com/ for example.
|
![]() |
![]() |
![]() |
#4 |
Senior Member
Join Date: Sep 2011
Posts: 106
|
i want know i can change *.js file using nsis?
|
![]() |
![]() |
![]() |
#5 | |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,358
|
Quote:
My point still stands, you cannot set the homepage this way. Setting the users homepage like this is usually done by spyware like applications, if you don't have evil intentions you should just let the user set the homepage. IntOp $PostCount $PostCount + 1 |
|
![]() |
![]() |
![]() |
#6 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,358
|
If you are rolling out Firefox in a domain environment I believe there are better ways of dealing with this than editing .js files that belong to the user. You should take a look at the unofficial Firefox MSI installers or edit the profile defaults in \FireFox\defaults\profile
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#7 |
Senior Member
Join Date: Sep 2011
Posts: 106
|
ok thanks
|
![]() |
![]() |
![]() |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|