Welcome, Guest
Username: Password: Remember me
Use this Category for your support questions about Virtuemart Template - PureMart (SKU# FLEX-00010)

TOPIC: [SOLVED] Unsafe Javascript caused by Facebook-Like

[SOLVED] Unsafe Javascript caused by Facebook-Like 11 years 5 months ago #930

Hi there,

I seem to be suffering the same Unsafe Javascript error as you are on your demo site... Is there a fix for this please?
Unsafe JavaScript attempt to access frame with URL: 
 
http://www.flexiblewebdesign.com/virtuemart-2-template-puremart/index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=37&virtuemart_category_id=2 
 
From frame with URL 
 
http://www.facebook.com/plugins/like.php?href=http://www.flexiblewebdesign.com/virtuemart-2-template-puremart/index.php&send=false&layout=standard&width=40&show_faces=false&action=like&colorscheme=light&font&height=35&appId=115329165206253. 
 
Domains, protocols and ports must match
Last Edit: 11 years 5 months ago by Support.
The topic has been locked.

Unsafe Javascript 11 years 5 months ago #937

Hi,
Having iframe in the website usually unexpected in most cases UNLESS you know the source. Nowadays youtube also gives iframe embed code to let you import the videos to your websites. Because iframe is easier. Just copy-paste the code and you rock!

That iframe belongs to FACEBOOK LIKE button. So there is nothing to worry about.
If you try to browse that URL:
www.facebook.com/plugins/like.php?href=http://www.flexiblewebdesign.com/virtuemart-2-template-puremart/index.php&send=false&layout=standard&width=40&show_faces=false&action=like&colorscheme=light&font&height=35&appId=115329165206253

You will see; it is facebook like button. It was generated through
developers.facebook.com/docs/reference/plugins/like/
go head and try to generate it by yourself. You will get the same HTML code for iframe version.

If you are experienced enough and you know how to implement the XFBML or HTML5 versions of LIKE button, facebook will give you ordinary codes (not iframe) and you can replace the ordinary codes with the iframe codes in the Virtuemart product details page, the unsafe error will be gone. But for HTML5 versions, you will need to Include the JavaScript SDK on your page once, ideally right after the opening <body> tag. XFBML version is little more sophisticated. Follow the tutorial in the facebook developers page for implementing the XFBML and HTML5 versions. They are somehow complicated and requires you to validate your website first.

If you decide to implement XFBML or HTML5, then find this PHP file:
ROOT/templates/<yourjoomlatemplate>/html/com_virtuemart/productdetails/default.php
And search this PHP file for "facebook" you will find the < iframe ... code, basically you are going to replace it with HTML5 or XFBML version.

Please let me know if you need any further assistance.

REFERENCE: stackoverflow.com/questions/4324108/unsafe-javascript-attempt-to-access-frame-with-url
(see this page, basically they are talking about the same thing. Unsafe JS issue that caused by LIKE button)

Cheers.
Last Edit: 11 years 5 months ago by Support.
The topic has been locked.

Unsafe Javascript 11 years 5 months ago #943

Thats great. Thanks for the info. If it's nothing to worry about then I shall stop worrying and continue building. Onwards and upwards.
The topic has been locked.

Unsafe Javascript 11 years 5 months ago #948

It is up to you, if you don't trust facebook.com, then it becomes unsafe :) and don't even use their LIKE button service at all.
But, don't worry, you are safe.

Case solved. Topic is closed.
The topic has been locked.
Time to create page: 0.080 seconds

MaterialMart

for Virtuemart 3

Google's Material Design has finally arrived to Virtuemart

Virtumart Template - MaterialMart Virtumart Template - CleanMart Virtumart Template - CleanMart Virtumart Template - CleanMart

Fully responsive!

Buy Now   |   Live Demo