You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have created a version of this polyfill that creates 2 classes SharePolyfill and ShareTarget this by default acts as a polyfill in addition to providing a default instance sharePolyfill
end users may then add more share targets by creating one and calling sharePolyfill.registerShareTarget()
if a user would like to disable native sharing they can ether reinitialize like so shareTarget = newShareTarget({forcePolyfill:true})
alternatively one could simply override the share function navigator.share = sharePolyfill.share
This is not really necessary though as if you can just use sharePolyfile.share() when needed and then leave navigator.share() fo use the native implementation and only fallback on sharePolyfill.
if you would like to test this implementation you can install it using npm install git+https://github.com/syonfox/share-api-polyfill.git
I have also added some default share targets but have yet to migrate every version help with that may be nice
here is a demo https://syonfox.github.io/share-api-polyfill/demo/
note that print still works and is simply disabled
Tested and working "gmail, yahoo, whatsapp, linkedin, telagram, facebook, twitter, get-pocket,
Purpose, I would like some feedback and for some people track down and implement a variety of share Targets.
preferably ones with no api requirement. but if for share targets that require a api we need to finish the default system for ShareTarget
If there is interest I can work towards a pull request let me know what y'all think.
The text was updated successfully, but these errors were encountered:
rsip22
changed the title
Add share target configureations and documentation
Add share target configurations and documentation
Oct 1, 2022
I have created a version of this polyfill that creates 2 classes SharePolyfill and ShareTarget this by default acts as a polyfill in addition to providing a default instance
sharePolyfill
end users may then add more share targets by creating one and calling
sharePolyfill.registerShareTarget()
docs ShareTarget
if a user would like to disable native sharing they can ether reinitialize like so
shareTarget = newShareTarget({forcePolyfill:true})
alternatively one could simply override the share function
navigator.share = sharePolyfill.share
This is not really necessary though as if you can just use
sharePolyfile.share()
when needed and then leavenavigator.share()
fo use the native implementation and only fallback on sharePolyfill.if you would like to test this implementation you can install it using
npm install git+https://github.com/syonfox/share-api-polyfill.git
<script src="/node_modules/share-api-polyfill/dist/share.js"></script>
navigator.share({url:'https://sharedgoalof.life', title: 'SGOL', text:'SO cool stuff '})
I have also added some default share targets but have yet to migrate every version help with that may be nice
here is a demo https://syonfox.github.io/share-api-polyfill/demo/
note that print still works and is simply disabled
Tested and working "gmail, yahoo, whatsapp, linkedin, telagram, facebook, twitter, get-pocket,
Purpose, I would like some feedback and for some people track down and implement a variety of share Targets.
preferably ones with no api requirement. but if for share targets that require a api we need to finish the default system for ShareTarget
If there is interest I can work towards a pull request let me know what y'all think.
The text was updated successfully, but these errors were encountered: