Skip to main content
Solved

Programmatically enable browser plugin

  • September 12, 2012
  • 3 replies
  • 0 views

Forum|alt.badge.img+24

Anyone know how to programmatically enable a browser plugin? Our VPN solution requires the Java plugin to be active and upon first launch it's disabled. Due to general Safari behavior, enabling the plugin and restarting Safari can become a less than optimal experience. If the Java plugin were enabled to begin with, it would be great.

Thanks

Best answer by karthikeyan_mac

Hi,

Refer to the below Rich link for enabling JAVA at login. (Thanks Rich)

https://github.com/rtrouton/rtrouton_scripts/tree/master/rtrouton_scripts/enable_java_web_plugins_at_login

Regards,
Karthikeyan

View original
Did this topic help you find an answer to your question?

3 replies

karthikeyan_mac
Forum|alt.badge.img+17
  • Honored Contributor
  • 281 replies
  • Answer
  • September 12, 2012

Hi,

Refer to the below Rich link for enabling JAVA at login. (Thanks Rich)

https://github.com/rtrouton/rtrouton_scripts/tree/master/rtrouton_scripts/enable_java_web_plugins_at_login

Regards,
Karthikeyan


Forum|alt.badge.img+24
  • Author
  • Valued Contributor
  • 1892 replies
  • September 12, 2012

Sa-weet.

Thanks. (Rich esp)


Forum|alt.badge.img+18
  • Valued Contributor
  • 1007 replies
  • September 12, 2012

i run this as a launch agent.

#!/usr/bin/perl -w

# config runtime environment
use strict;
use Getopt::Std;
use Sys::Syslog;
use Env qw(HOME);

my $MAC_UUID =system_profiler SPHardwareDataType | awk -F" " '/UUID/{print $3}';
chomp($MAC_UUID);
my $byhostdir = $HOME . "/Library/Preferences/ByHost/";
my $date = time - 978307200;
my $javapref = $byhostdir . "com.apple.java.JavaPreferences.$MAC_UUID.plist";
my $plistcmd = "/usr/libexec/PlistBuddy";

(my $progname =$0) =~ s#.*/##;
$ENV{PATH} = '/bin:/usr/bin:/usr/sbin';
umask 0022;

main:
openlog $progname, undef, 'user';
system("mkdir -p $byhostdir") unless (-d $byhostdir);
# Activates the "Enable applet plug-in and Web Start Applications" setting in Java Preferences
syslog('notice', "ensuring Java WebPlugin is enabled.");
system("$plistcmd -c "Add :GeneralByTask:Any:PrefsVersion string 2" $javapref");
system("$plistcmd -c "Add :GeneralByTask:Any:WebComponentsEnabled bool true" $javapref");
system("$plistcmd -c "Add :GeneralByTask:Any:WebComponentsLastUsed real $date" $javapref");
syslog('notice', "startup script complete");
closelog;
exit 0;


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings