linterna-magica-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linterna-magica-commit] [112] Changes for tasks #11216.


From: Ivaylo Valkov
Subject: [linterna-magica-commit] [112] Changes for tasks #11216.
Date: Tue, 05 Jul 2011 15:21:47 +0000

Revision: 112
          
http://svn.sv.gnu.org/viewvc/?view=rev&root=linterna-magica&revision=112
Author:   valkov
Date:     2011-07-05 15:21:46 +0000 (Tue, 05 Jul 2011)
Log Message:
-----------
Changes for tasks #11216. Added rule for skipping iframe detection. used with 
dailymotion.

Ticket Links:
------------
    http://savannah.gnu.org/task/?11216

Modified Paths:
--------------
    branches/task-11216/src/lm_detect_flash.js
    branches/task-11216/src/lm_site_dailymotion.js
    branches/task-11216/src/lm_sites.js

Modified: branches/task-11216/src/lm_detect_flash.js
===================================================================
--- branches/task-11216/src/lm_detect_flash.js  2011-07-05 14:51:34 UTC (rev 
111)
+++ branches/task-11216/src/lm_detect_flash.js  2011-07-05 15:21:46 UTC (rev 
112)
@@ -112,13 +112,18 @@
        }
        // Not a swf but best to detect remotely embedded clips with
        // current logic.
-       else if (element.localName.toLowerCase() == "iframe" &&
-                // Without this and if Flashblock is installed, it
-                // will replace an iframe that has something to do
-                // with tweeter. This way the Flashblock blocked
-                // object is replaced.
-                !/dailymotion\.com/i.test(window.location.hostname))
+       else if (element.localName.toLowerCase() == "iframe")
        {
+           var self = this;
+           var val = this.call_site_function_at_position.apply(self,[
+               "do_not_force_iframe_detection",
+               window.location.hostname]);
+
+           if (!val)
+           {
+               return false;
+           }
+
            is_swf = true;
            detected_via = "forced for iframe";
        }

Modified: branches/task-11216/src/lm_site_dailymotion.js
===================================================================
--- branches/task-11216/src/lm_site_dailymotion.js      2011-07-05 14:51:34 UTC 
(rev 111)
+++ branches/task-11216/src/lm_site_dailymotion.js      2011-07-05 15:21:46 UTC 
(rev 112)
@@ -90,3 +90,13 @@
     // (DOM 0,1...).
     return "; domain=.dailymotion.com; path=/; 
host="+window.location.hostname+"; ";
 }
+
+LinternaMagica.prototype.sites["dailymotion.com"].do_not_force_iframe_detection
 =
+function()
+{
+    // If Flashblock is installed, it will replace an iframe that has
+    // something to do with Twitter. We have to replace the Flashblock
+    // blocked object. Returning, false will make the logic in
+    // lm_detect_flash.js not detect the iframe as swf.
+    return false;
+}

Modified: branches/task-11216/src/lm_sites.js
===================================================================
--- branches/task-11216/src/lm_sites.js 2011-07-05 14:51:34 UTC (rev 111)
+++ branches/task-11216/src/lm_sites.js 2011-07-05 15:21:46 UTC (rev 112)
@@ -78,7 +78,15 @@
 }
 
 // LinternaMagica.prototype.sites.__css_style_fix
-// LinternaMagica.prototype.sites.__detect_flash_ // Useless?
+
+// Used to skip detection (as swf) of iframes. Not used in most
+// sites. See lm_site_dailymotion.js:do_not_force_iframe_detection.
+LinternaMagica.prototype.sites.__do_not_force_iframe_detection =
+function()
+{
+    return true;
+}
+
 // LinternaMagica.prototype.sites.__skip_video_id_extract // DM force?
 // LinternaMagica.prototype.sites.__skip_xhr_if_video_id
 // LinternaMagica.prototype.sites.__wait_before_xhr




reply via email to

[Prev in Thread] Current Thread [Next in Thread]