BrowserView.js
authorAlan Knowles <alan@roojs.com>
Thu, 14 Apr 2016 07:54:03 +0000 (15:54 +0800)
committerAlan Knowles <alan@roojs.com>
Thu, 14 Apr 2016 07:54:03 +0000 (15:54 +0800)
BrowserView.js

index 7f7d177..b97208a 100644 (file)
@@ -269,50 +269,8 @@ BrowserView = new GType({
         var done_print = false;
         var do_print = function(web_frame) {
             
+            var queue_print = 0;
             
-            if (done_print) {
-                print("do_print called -- while already doing this...");
-                return;
-            }
-            done_print = true;
-            print("do_print called");
-            
-        
-            TabbedBrowser.browser.current_tab().get_web_view().execute_script(
-                    File.read( __script_path__ + "/domains/remove_print_css.js")
-            );
-            
-            var url_p = current_url.split('/');
-            var dom = url_p[2];
-            var dom_p = url_p[2].split('.');
-            var chk = dom_p.pop();
-            chk = dom_p.pop() + '.' + chk;
-            
-            
-            
-            print("CHECK: " + chk +"\n");
-            if (File.exists( __script_path__ + "/domains/" + chk + '.js')) {
-                print("INCLUDING: " + __script_path__ + "/domains/"+ chk + ".js\n");
-                TabbedBrowser.browser.current_tab().get_web_view().execute_script(
-                    File.read( __script_path__ + "/domains/"+ chk + ".js")
-                );
-            }
-             
-            
-            // motorme - requires a scroll to make content appear..
-            if (current_url.match(/\.motorme\.my\//) ) {
-                TabbedBrowser.browser.current_tab().get_web_view().execute_script("window.scrollTo(0,500);"); 
-                              
-            }
-            
-            if (current_url.match('/forbes.com')) {
-                v
-            }
-            
-           
-            print("Delay:" + BrowserSettings.delay);
-         
-         
             var realprint = function() {
                 
                 try {
@@ -367,6 +325,51 @@ BrowserView = new GType({
                 }
             };
          
+            
+            
+            if (done_print) {
+                print("do_print called -- while already doing this...");
+                return;
+            }
+            done_print = true;
+            print("do_print called");
+            
+        
+            TabbedBrowser.browser.current_tab().get_web_view().execute_script(
+                    File.read( __script_path__ + "/domains/remove_print_css.js")
+            );
+            
+            var url_p = current_url.split('/');
+            var dom = url_p[2];
+            var dom_p = url_p[2].split('.');
+            var chk = dom_p.pop();
+            chk = dom_p.pop() + '.' + chk;
+            
+            
+            
+            print("CHECK: " + chk +"\n");
+            if (File.exists( __script_path__ + "/domains/" + chk + '.js')) {
+                print("INCLUDING: " + __script_path__ + "/domains/"+ chk + ".js\n");
+                TabbedBrowser.browser.current_tab().get_web_view().execute_script(
+                    File.read( __script_path__ + "/domains/"+ chk + ".js")
+                );
+            }
+             
+            
+            // motorme - requires a scroll to make content appear..
+            if (current_url.match(/\.motorme\.my\//) ) {
+                TabbedBrowser.browser.current_tab().get_web_view().execute_script("window.scrollTo(0,500);"); 
+                              
+            }
+            
+            if (current_url.match('/forbes.com')) {
+                v
+            }
+            
+           
+            print("Delay:" + BrowserSettings.delay);
+         
+         
          
             GLib.timeout_add(GLib.PRIORITY_DEFAULT, BrowserSettings.delay *1, realprint);
         }