Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8944897
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:07:31+00:00 2026-06-15T12:07:31+00:00

I’d like to use social sharing widgets (e.g. Facebook Like, Twitter Tweet, etc) on

  • 0

I’d like to use social sharing widgets (e.g. Facebook Like, Twitter Tweet, etc) on my site, but I don’t want to directly embed third-party script tags. I’d like my site to only run either trusted or sandboxed code.

  • Google Caja might work, but it requires the third-party code be written specifically to accommodate Caja.
  • Content Security Policy might work, but it is sparsely implemented, especially with IE (even 10) and there’s no good way to detect if it’s even present.

Is there a solution to this? Or do I have to choose between not having the buttons at all and running untrusted JavaScript?

Additional context: I’d like to run my entire site on HTTPS, but I also want to have sharing buttons. I don’t want to potentially leak secure cookies to Facebook or Twitter.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T12:07:32+00:00Added an answer on June 15, 2026 at 12:07 pm

    If you don’t trust third-party JavaScript (and I don’t blame you, it’s scary!), your best bet is to use the iframe implementations that these social networks provide. For instance, you can include a Facebook “Like” button by adding the following frame to your site:

    <iframe src="//www.facebook.com/plugins/like.php?href=[PAGE_URL_GOES_HERE]&amp;send=false&amp;layout=button_count&amp;width=450&amp;show_faces=true&amp;font&amp;colorscheme=light&amp;action=like&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:21px;" allowTransparency="true"></iframe>
    

    https://dev.twitter.com/docs/tweet-button#using-an-iframe has details on a similar setup for Twitter.

    Encapsulating the code in an iframe gives you some measure of protection against the content of the frame, as it can’t reach up into the parent to grab data or manipulate your code.

    You can increase the level of protection by sandboxing the iframe via the (cleverly named) sandbox attribute. For instance:

    <iframe sandbox="allow-script allow-same-origin" src="..."></iframe>
    

    would load a page into an iframe, and allow it to run script with access to its origin (but still not the parent’s origin). It would not, however, be able to navigate the top level document, load plugins, etc. Sandboxing is supported in Chrome, Safari, Firefox 18+, and IE9 (I think. Might be 10.).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
I want to count how many characters a certain string has in PHP, but
I want use html5's new tag to play a wav file (currently only supported
I want to construct a data frame in an Rcpp function, but when I
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
For some reason, after submitting a string like this Jack’s Spindle from a text
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I've got a string that has curly quotes in it. I'd like to replace

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.