New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

sharon

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sharon - npm Package Compare versions

Comparing version 1.6.0 to 2.0.0-beta.0

core/popup.js

4

CHANGELOG.md

@@ -0,1 +1,5 @@

## 2.0.0-beta.0
Add sharon.*network*.defer method to avoid the popup blockers.
## 1.6.0

@@ -2,0 +6,0 @@

30

core/share-factory.js

@@ -1,25 +0,25 @@

/**
* The definition of window.open:
* https://html.spec.whatwg.org/multipage/browsers.html#dom-open
*
* The definition of the features argument:
* https://drafts.csswg.org/cssom-view/#the-features-argument-to-the-open()-method
*/
var popup = require('./popup');
var count = 0;
module.exports = function (href, width, height) {
function share() {
var url = href.apply(this, arguments);
popup(url, null, width, height);
}
if (width) {
var top = Math.max(0, Math.round(((screen.height / 3) - (height / 2))));
var left = Math.round((screen.width - width) / 2);
share.defer = function (url) {
url = url || 'about:blank';
var name = 'sharon' + count++;
window.open(url, null, 'width=' + width + ',height=' + height + ',top=' + top + ',left=' + left + ',location,resizable,scrollbars,toolbar=no');
} else {
window.open(url);
}
}
popup(url, name, width, height);
return function () {
var url = href.apply(this, arguments);
popup(url, name);
};
};
share.href = href;
return share;
};

@@ -1,2 +0,2 @@

var sharon=function(){"use strict";var t=0,e=function(e,n){var r=e.url||e,o=e.object||window,i=e.key||"j"+t++,c=void 0===e.parameter?"callback":e.parameter,u=document.createElement("script");u.src=c?r+(~r.indexOf("?")?"&":"?")+c+"="+i:r,u.onerror=function(){delete o[i],n(Error())},o[i]=function(t){delete o[i],n(null,t)},document.head.removeChild(document.head.appendChild(u))},n=e,r=function(t,e,r){return function(o,i){arguments.length<2&&(i=o,o=location),n({url:t+"="+encodeURIComponent(o),parameter:r},function(t,n){return t?i(t):void i(null,e(n))})}},o=function(t,e){return e&&Object.keys(e).forEach(function(n){t[n]=e[n]}),t},i=o,c=function(t,e){return e=e||{},function(n,r){"string"==typeof n?r=i({url:n},r):(r=i({url:location},n),e.title&&(r.title=r.title||document.title));var o=Object.keys(r).map(function(t){var n=e[t]||t;return Array.isArray(r[t])?n+"="+r[t].map(encodeURIComponent):n+"="+encodeURIComponent(r[t])});return t+(~t.indexOf("?")?"&":"?")+o.join("&")}},u=function(t,e,n){function r(){var r=t.apply(this,arguments);if(e){var o=Math.max(0,Math.round(screen.height/3-n/2)),i=Math.round((screen.width-e)/2);window.open(r,null,"width="+e+",height="+n+",top="+o+",left="+i+",location,resizable,scrollbars,toolbar=no")}else window.open(r)}return r.href=t,r},a=r,s=c,l=u,h=s("https://buffer.com/add",{title:"text"}),p=l(h,850,600),d=a("https://api.bufferapp.com/1/links/shares.json?url",function(t){return t.shares});p.count=d;var m=r,w=c,f=u,v=w("https://www.facebook.com/sharer.php",{url:"u"}),b=f(v,670,340),k=m("https://graph.facebook.com/?id",function(t){return t.share?t.share.share_count:0});b.count=k;var g=c,x=u,j=g("https://mail.google.com/mail/?view=cm",{title:"su",url:"body"}),y=x(j,800,632),C=r,U=c,O=u,I=U("https://www.linkedin.com/shareArticle",{title:"title"}),R=O(I,600,400),A=C("https://www.linkedin.com/countserv/count/share?url",function(t){return t.count});R.count=A;var E=e,M=function(t,e,n){return function(r,o){arguments.length<2&&(o=r,r=location);var i=n.length+"";E({url:t+encodeURIComponent(r)+e+i,parameter:!1,object:n,key:i},o)}},K=M,L=c,S=u,_=L("https://connect.ok.ru/dk?st.cmd=WidgetSharePreview",{url:"st.shareUrl"}),z=S(_,580,350),D=[];window.ODKL={updateCount:function(t,e){D[t](+e)}};var N=K("https://connect.ok.ru/dk?st.cmd=extLike&ref=","&uid=",D);z.count=N;var P=r,V=c,W=u,q=V("https://www.pinterest.com/pin/create/button/",{title:"description"}),B=W(q,750,320),F=P("https://api.pinterest.com/v1/urls/count.json?url",function(t){return t.count});B.count=F;var G=r,H=c,J=u,Q=H("https://plus.google.com/share"),T=J(Q,600,600),X=G("https://share.yandex.ru/gpp.xml?url",Number);T.count=X;var Y=r,Z=c,$=u,tt=Z("https://www.reddit.com/submit",{title:"title"}),et=$(tt),nt=Y("https://www.reddit.com/api/info.json?url",function(t){return t.data.children.reduce(function(t,e){return t+e.data.score},0)},"jsonp");et.count=nt;var rt=c,ot=u,it=rt("https://t.me/share",{title:"text"}),ct=ot(it,600,500),ut=r,at=c,st=u,lt=at("https://www.tumblr.com/widgets/share/tool",{title:"title",url:"canonicalUrl"}),ht=st(lt,557,600),pt=ut("https://api.tumblr.com/v2/share/stats?url",function(t){return t.response.note_count});ht.count=pt;var dt=c,mt=u,wt=dt("https://twitter.com/intent/tweet",{title:"text"}),ft=mt(wt,550,420),vt=M,bt=c,kt=u,gt=bt("https://vk.com/share.php"),xt=kt(gt,650,610),jt=[];window.VK={Share:{count:function(t,e){jt[t](e)}}};var yt=vt("https://vk.com/share.php?act=count&url=","&index=",jt);return xt.count=yt,{buffer:p,facebook:b,gmail:y,linkedin:R,ok:z,pinterest:B,plus:T,reddit:et,telegram:ct,tumblr:ht,twitter:ft,vk:xt,weibo:u(c("http://service.weibo.com/share/share.php",{title:"title"}),615,505),xing:u(c("https://www.xing.com/spi/shares/new"),570,530)}}();
var sharon=function(){"use strict";var t=0,e=function(e,n){var r=e.url||e,o=e.object||window,i=e.key||"j"+t++,c=void 0===e.parameter?"callback":e.parameter,u=document.createElement("script");u.src=c?r+(~r.indexOf("?")?"&":"?")+c+"="+i:r,u.onerror=function(){delete o[i],n(Error())},o[i]=function(t){delete o[i],n(null,t)},document.head.removeChild(document.head.appendChild(u))},n=e,r=function(t,e,r){return function(o,i){arguments.length<2&&(i=o,o=location),n({url:t+"="+encodeURIComponent(o),parameter:r},function(t,n){if(t)return i(t);i(null,e(n))})}},o=function(t,e){return e&&Object.keys(e).forEach(function(n){t[n]=e[n]}),t},i=o,c=function(t,e){return e=e||{},function(n,r){"string"==typeof n?r=i({url:n},r):(r=i({url:location},n),e.title&&(r.title=r.title||document.title));var o=Object.keys(r).map(function(t){var n=e[t]||t;return Array.isArray(r[t])?n+"="+r[t].map(encodeURIComponent):n+"="+encodeURIComponent(r[t])});return t+(~t.indexOf("?")?"&":"?")+o.join("&")}},u=function(t,e,n,r){if(n){var o=Math.max(0,Math.round(screen.height/3-r/2)),i=Math.round((screen.width-n)/2);window.open(t,e,"width="+n+",height="+r+",top="+o+",left="+i+",location,resizable,scrollbars,toolbar=no")}else window.open(t,e)},a=u,s=0,l=function(t,e,n){function r(){var r=t.apply(this,arguments);a(r,null,e,n)}return r.defer=function(r){r=r||"about:blank";var o="sharon"+s++;return a(r,o,e,n),function(){var e=t.apply(this,arguments);a(e,o)}},r.href=t,r},h=r,p=c,d=l,m=p("https://buffer.com/add",{title:"text"}),f=d(m,850,600),w=h("https://api.bufferapp.com/1/links/shares.json?url",function(t){return t.shares});f.count=w;var v=r,b=c,k=l,g=b("https://www.facebook.com/sharer.php",{url:"u"}),x=k(g,670,340),y=v("https://graph.facebook.com/?id",function(t){return t.share?t.share.share_count:0});x.count=y;var j=c,C=l,U=j("https://mail.google.com/mail/?view=cm",{title:"su",url:"body"}),O=C(U,800,632),I=r,R=c,A=l,E=R("https://www.linkedin.com/shareArticle",{title:"title"}),M=A(E,600,400),K=I("https://www.linkedin.com/countserv/count/share?url",function(t){return t.count});M.count=K;var L=e,S=function(t,e,n){return function(r,o){arguments.length<2&&(o=r,r=location);var i=n.length+"";L({url:t+encodeURIComponent(r)+e+i,parameter:!1,object:n,key:i},o)}},_=S,z=c,D=l,N=z("https://connect.ok.ru/dk?st.cmd=WidgetSharePreview",{url:"st.shareUrl"}),P=D(N,580,350),V=[];window.ODKL={updateCount:function(t,e){V[t](+e)}};var W=_("https://connect.ok.ru/dk?st.cmd=extLike&ref=","&uid=",V);P.count=W;var q=r,B=c,F=l,G=B("https://www.pinterest.com/pin/create/button/",{title:"description"}),H=F(G,750,320),J=q("https://api.pinterest.com/v1/urls/count.json?url",function(t){return t.count});H.count=J;var Q=r,T=c,X=l,Y=T("https://plus.google.com/share"),Z=X(Y,600,600),$=Q("https://share.yandex.ru/gpp.xml?url",Number);Z.count=$;var tt=r,et=c,nt=l,rt=et("https://www.reddit.com/submit",{title:"title"}),ot=nt(rt),it=tt("https://www.reddit.com/api/info.json?url",function(t){return t.data.children.reduce(function(t,e){return t+e.data.score},0)},"jsonp");ot.count=it;var ct=c,ut=l,at=ct("https://t.me/share",{title:"text"}),st=ut(at,600,500),lt=r,ht=c,pt=l,dt=ht("https://www.tumblr.com/widgets/share/tool",{title:"title",url:"canonicalUrl"}),mt=pt(dt,557,600),ft=lt("https://api.tumblr.com/v2/share/stats?url",function(t){return t.response.note_count});mt.count=ft;var wt=c,vt=l,bt=wt("https://twitter.com/intent/tweet",{title:"text"}),kt=vt(bt,550,420),gt=S,xt=c,yt=l,jt=xt("https://vk.com/share.php"),Ct=yt(jt,650,610),Ut=[];window.VK={Share:{count:function(t,e){Ut[t](e)}}};var Ot=gt("https://vk.com/share.php?act=count&url=","&index=",Ut);return Ct.count=Ot,{buffer:f,facebook:x,gmail:O,linkedin:M,ok:P,pinterest:H,plus:Z,reddit:ot,telegram:st,tumblr:mt,twitter:kt,vk:Ct,weibo:l(c("http://service.weibo.com/share/share.php",{title:"title"}),615,505),xing:l(c("https://www.xing.com/spi/shares/new"),570,530)}}();
//# sourceMappingURL=sharon.min.js.map
{
"name": "sharon",
"version": "1.6.0",
"version": "2.0.0-beta.0",
"description": "A lightweight and modular social sharing library",

@@ -5,0 +5,0 @@ "keywords": [

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc