Bug 110308

Summary: Akregator: klauncher said: Unknown protocol 'javascript'
Product: [Applications] akregator Reporter: Colin J Thomson <colin.thomson>
Component: internal browserAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: f.leerink, giovanni.bobbio, KDE.fanboy, osterfeld, pau.capdevila, rdieter, rossi.f, true.friend2004
Priority: NOR    
Version: 1.1.2   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Fix "javascript:" unknown protocol errors.

Description Colin J Thomson 2005-08-06 21:14:45 UTC
Version:           1.1.2 (using KDE KDE 3.4.2)
Installed from:    Unlisted Binary Package
OS:                Linux

Go to kde-look and open an article, right click on the Screenshot Thumbnail so it opens 
in a new tab, now usually (akregator in kde-3.4.1) clicking on the Full size Screenshot or the "close" option closes the 
window but now I get this Error:

Could not start process Unable to create io-slave:
klauncher said: Unknown protocol 'javascript'.
Comment 1 Avuton Olrich 2005-09-30 05:23:14 UTC
This appears to be a dup from 103076
Comment 2 Frank Osterfeld 2005-09-30 07:27:11 UTC
No, this is about javascript: links, the other about popups not working. The links that open the popups don't use javascript, at least not on kde-apps. (And opening the link explicitely via "open in new tab" works there).
Comment 3 Colin J Thomson 2005-10-27 22:05:08 UTC
FYI, this problem is still here using kde-3.4.3 which has Akregator-1.1.3, so as a test I installed Akregator-1.0.1, and Clicking on the Screenhots or the [close] on the articles preview window it works fine, no Javascript error
Comment 4 Pau Capdevila 2006-02-01 01:38:33 UTC
I confirm it in akg. 1.2.1 under kde 3.5
Comment 5 Stephan Sokolow 2006-08-04 09:36:54 UTC
I can confirm in 1.2.2 under KDE 3.5.2
Comment 6 Frank Osterfeld 2006-08-04 09:41:13 UTC
to save a post, it's still not fixed until today, (post 1.2.4).
Comment 7 Frank Osterfeld 2006-08-13 11:05:35 UTC
*** Bug 132287 has been marked as a duplicate of this bug. ***
Comment 8 KDEfanboy 2006-08-16 14:20:14 UTC
Created attachment 17391 [details]
Fix "javascript:" unknown protocol errors.

How about something like this?
Comment 9 Muhammad Shakir Aziz 2006-08-18 21:14:37 UTC
KDEfanboy:
is it ok now????
Comment 10 KDEfanboy 2006-08-20 01:10:47 UTC
Muhammad, try it and report if it works for you. I haven't run into "javascript: protocol error" problems since patching. Because it's code straight out of the KHTMLPart source[1] for the base implementation of urlSelectedIntern (which does the protocol check and executes the script), I imagine it should work in all execution cases. Though, as Frank pointed out in IRC, javascript calls that request opening urls and new windows won't open anything because all the BrowserExtension signals haven't been slotted yet. Assuming this patch works for you, at least other useful script functions can be used for now.

A few quick example to test: if the screenshot previews close when you click them from articles in
http://www.kde.org/kde-look-content.rdf
http://www.kde.org/dot/kde-apps-content.rdf

If you can "digg" articles (need an account) from arcticles in
http://digg.com/rss/containertechnology.xml

And test any other feeds you have that you can click through to pages which call 'javascript:' urls upon clicking.

[1] http://developer.kde.org/documentation/library/3.5-api/kdelibs-apidocs/khtml/html/khtml__part_8cpp-source.html
Comment 11 Muhammad Shakir Aziz 2006-08-20 08:19:41 UTC
so it is ok in ur thinking.
hay buddy i m not much old in linux world. a few months ago i m here. so guide me how to apply the changes in akregator.
i am using it in gnome ;).
ur provided likns are full of codes. i do not know where it to be applied.
Comment 12 KDEfanboy 2006-08-20 17:24:01 UTC
Muhammad, in that case, good luck. :P
Follow these instructions, and if you have problems, just email me:
http://rafb.net/paste/results/Zax6c134.nln.html
Comment 13 Frank Osterfeld 2006-08-20 17:35:31 UTC
Don't do that, it could break your KDE-PIM installation if you do not know what you are doing and how to set up KDEDIRS and PATH right.
Better wait for 3.5.5 where this should be fixed.
Comment 14 Muhammad Shakir Aziz 2006-08-21 08:50:14 UTC
and when it is going to be realesed???
Comment 15 vicaya 2006-10-13 01:16:27 UTC
Looks like the problem persists in KDE 3.5.5.

According to "About Akregator", I'm using Akregator 1.2.5 (Using KDE 3.5.5).

This is the result when I click the digg link (the motivation for me to upgrade to KDE 3.5.5)

An error occurred while loading javascript:wrapper_full(1,5,570373,'e934e775800f59bae5b3aff49c5c5dc6'):
Could not start process Unable to create io-slave:
klauncher said: Unknown protocol 'javascript'.
Comment 16 Stephan Sokolow 2006-10-13 04:39:17 UTC
Someone should check whether the problem persists with the "Enable javascript to allow bookmarklets" KIOSlave installed.
Comment 17 Frank Osterfeld 2006-10-13 06:27:26 UTC
The patch was never applied, because it fixed the problem only partially. I wanted to get it "right", but then whole issue lost focus and got forgotten. Sorry, you'll have to wait for 3.5.6.
Comment 18 vicaya 2007-01-25 19:45:38 UTC
Is this fixed in 3.5.6? I didn't see it mentioned in the change log. Akregator would be close to perfect to me if this is fixed.
Comment 19 Colin J Thomson 2007-01-25 20:46:40 UTC
Almost :) Clicking on the Thumbnail now brings up the full size pic, if there is more than 1 pic in the preview choosing them works. Clicking on the Pic or the "close" option pops up this error:

An error occurred while loading javascript:self.close():
Could not start process Unable to create io-slave:
klauncher said: Unknown protocol 'javascript'.

So I use the back button for now.

FC6 kde-redhat.3.5.6-3 (Testing)
Comment 20 vicaya 2007-01-26 06:09:47 UTC
kde-look changed their fullsize popup url to use href with target instead of javascript:..., which is still not handled in akregator. I wonder what's holding this back...
Comment 21 Frank Osterfeld 2007-01-26 11:14:38 UTC
> I wonder what's holding this back... 

The broken browser implementation in the 3.5 branch.
Comment 22 Eckhart Wörner 2007-02-18 21:49:23 UTC
*** Bug 141882 has been marked as a duplicate of this bug. ***
Comment 23 Frank Osterfeld 2007-02-25 11:08:33 UTC
SVN commit 637065 by osterfeld:

partially fix "javascript:" links in the browser tabs
patch by KDEfanboy 
CCBUG: 110308


 M  +12 -5     pageviewer.cpp  


--- branches/KDE/3.5/kdepim/akregator/src/pageviewer.cpp #637064:637065
@@ -356,15 +356,22 @@
 
 void PageViewer::urlSelected(const QString &url, int button, int state, const QString &_target, KParts::URLArgs args)
 {
-    if (button == LeftButton)
+    if (url.startsWith(QString::fromLatin1( "javascript:" ), /*case-sensitive=*/false) )
     {
-        m_url = completeURL(url);
-        browserExtension()->setURLArgs(args); 
-        slotOpenLinkInThisTab();
+        KHTMLPart::urlSelected(url,button,state,_target,args);
     }
     else
     {
-        Viewer::urlSelected(url,button,state,_target,args);
+        if (button == LeftButton)
+        {
+            m_url = completeURL(url);
+            browserExtension()->setURLArgs(args); 
+            slotOpenLinkInThisTab();
+        }
+        else
+        {
+            Viewer::urlSelected(url,button,state,_target,args);
+        }
     }
 }
 
Comment 24 Allen Winter 2007-02-25 22:39:19 UTC
SVN commit 637252 by winterz:

merge SVN commit 637065 by osterfeld:

partially fix "javascript:" links in the browser tabs
patch by KDEfanboy 
CCBUG: 110308


 M  +12 -5     branches/work/kdepim-3.5.5+/akregator/src/pageviewer.cpp  


--- branches/work/kdepim-3.5.5+/akregator/src/pageviewer.cpp #637251:637252
@@ -356,15 +356,22 @@
 
 void PageViewer::urlSelected(const QString &url, int button, int state, const QString &_target, KParts::URLArgs args)
 {
-    if (button == LeftButton)
+    if (url.startsWith(QString::fromLatin1( "javascript:" ), /*case-sensitive=*/false) )
     {
-        m_url = completeURL(url);
-        browserExtension()->setURLArgs(args); 
-        slotOpenLinkInThisTab();
+        KHTMLPart::urlSelected(url,button,state,_target,args);
     }
     else
     {
-        Viewer::urlSelected(url,button,state,_target,args);
+        if (button == LeftButton)
+        {
+            m_url = completeURL(url);
+            browserExtension()->setURLArgs(args); 
+            slotOpenLinkInThisTab();
+        }
+        else
+        {
+            Viewer::urlSelected(url,button,state,_target,args);
+        }
     }
 }
 
Comment 25 vicaya 2007-04-14 10:20:10 UTC
I can confirm akregator 1.2.6 using KDE 3.5.6 works with this patch. Thank you.
Comment 26 Frank Osterfeld 2008-08-22 21:31:31 UTC
Fixed in trunk