11//$.readyForClickedNotifications = false; // the hangouts site takes some time to load...
2+ // https://webrtchacks.com/hangout-analysis-philipp-hancke/
23
34var delegate = { } ; // our delegate to receive events from the webview app
45
56delegate . decideNavigationForClickedURL = function ( url ) { $ . sysOpenURL ( url ) ; return true ; }
67delegate . decideNavigationForMIME = function ( url ) { return false ; }
78delegate . decideWindowOpenForURL = function ( url ) {
8- if ( ~ url . indexOf ( "https://plus.google.com/hangouts/_" ) ) { //G+ hangouts a/v chat
9- //$.sysOpenURL(url, "com.google.Chrome"); // use Hangouts Pepper WebRTC plugin
10- $ . newAppTabWithJS ( url ) ;
11- $ . switchToNextTab ( ) ;
9+ $ . conlog ( "JScore: catching window.open() " + url ) ;
10+ if ( ~ url . indexOf ( "https://plus.google.com/hangouts/_/" ) ) { //G+ hangouts a/v chat
11+ $ . sysOpenURL ( url , "com.google.Chrome" ) ; // use Hangouts Pepper WebRTC plugin
12+ //$.newAppTabWithJS(url);
13+ //$.switchToNextTab();
1214 return true ;
1315 } ;
1416 //if url ^= https://talkgadget.google.com/u/0/talkgadget/_/frame
@@ -41,6 +43,7 @@ delegate.launchURL = function(url) { // $.sysOpenURL(/[sms|hangouts|tel]:.*/) ca
4143 } ;
4244} ;
4345
46+ //addEventListener('receivedHangoutsMessage', function(e){...}, false); ??
4447delegate . receivedHangoutsMessage = function ( msg ) {
4548 // receives events from JS in 1st AppTab
4649 // -> webkit.messageHandlers.receivedHangoutMessage.postMessage([from, replyTo, msg]);
@@ -51,12 +54,13 @@ delegate.receivedHangoutsMessage = function(msg) {
5154
5255delegate . handleClickedNotification = function ( from , url , msg ) {
5356 $ . conlog ( "JS: opening notification for: " + [ from , url , msg ] ) ;
54- // $.sysOpenURL(url); //will end back up at launchURL
57+ $ . sysOpenURL ( url ) ; //will end back up at launchURL
5558 return true ;
5659} ;
5760
5861delegate . unhideApp = function ( msg ) { $ . unhideApp ( ) ; } ;
5962
63+ //addEventListener('HangoutsRosterReady', function(e){...}, false); ??
6064delegate . HangoutsRosterReady = function ( msg ) { // notifier.js will call this when roster div is created
6165 //$.readyForClickedNotifications = true;
6266 if ( $ . lastLaunchedURL != '' ) { //app was launched by an opened URL or a clicked notification - probably a [sms|tel]: link
@@ -66,7 +70,7 @@ delegate.HangoutsRosterReady = function(msg) { // notifier.js will call this whe
6670} ;
6771
6872delegate . AppFinishedLaunching = function ( ) {
69- $ . toggleTransparency ( ) ;
73+ $ . isTransparent = true ;
7074 $ . registerURLScheme ( 'sms' ) ;
7175 $ . registerURLScheme ( 'tel' ) ;
7276 $ . registerURLScheme ( 'hangouts' ) ;
0 commit comments