
Security News
Critical Security Vulnerability in React Server Components
React disclosed a CVSS 10.0 RCE in React Server Components and is advising users to upgrade affected packages and frameworks to patched versions now.
@digital-butlers/share-page-links
Advanced tools
A convenient library with share page links for everyday tasks
<section>
<a href="" data-network-name="whats-app">WhatsApp</a>
<a href="" data-network-name="facebook">Facebook</a>
<a href="" data-network-name="twitter">Twitter</a>
<a href="" data-network-name="x">X</a>
<a href="" data-network-name="linkedin">Linkedin</a>
<a href="" data-network-name="telegram">Telegram</a>
<a href="" data-network-name="email">Email</a>
</section>
import { SharePageLinks } from '@digital-butlers/components/share-page-links';
const shareLinks = new SharePageLinks({
messageForShareViaEmail: "This is really important! Don't miss it", // the text to insert in the "body of the message" field (if we share a link to the page in the email)
pageName: 'Custom page name', // if there is no 'title', 'h1', '[role="heading"][aria-level="1"]' on the page, this text will be used instead
});
shareLinks.init();
Will copy the current page URL to the clipboard
<button data-copy-button>Copy link</button>
Will copy custom value from 'data-copy-value' attribute
<button data-copy-button data-copy-value="Hello world!">Copy link</button>
messageForShareViaEmailType:
string
Default:
'I think it will be interesting for you to read this article'
Description:
The text to insert in the "subject of the message" field (if we share a link to the page in the email)
Description_RU:
Текст, который будет вставлен в поле "тема сообщения" (если мы делимся ссылкой на страницу по электронной почте)
pageNameType:
string
Default:
'We recommend it for reading'
Description:
If there is no 'title', 'h1', '[role="heading"][aria-level="1"]' on the page, this text will be used instead
Description_RU:
Если на странице нет 'title', 'h1', '[role="heading"][aria-level="1"]', будет использован этот текст
onType:
object
Default:
{}
Description:
Object with callbacks
Description_RU:
Объект с функциями обратного вызова
copyButtonSelectorType:
string
Default:
'[data-copy-button]'
Description:
Selector for the copy button
Description_RU:
Селектор для кнопки копирования
tooltipSelectorType:
string
Default:
'[data-copy-button-tooltip]'
Description:
Selector for the tooltip
Description_RU:
Селектор для всплывающей подсказки
afterInitType:
function
Default:
undefined
Description:
Callback will be started after SharePageLinks initialization
Description_RU:
Функция обратного вызова, которая будет запущена после инициализации SharePageLinks
copyType:
function
Default:
undefined
Description:
Callback will be started after
Description_RU:
Функция обратного вызова, которая будет запущена после копирования
const shareLinks = new SharePageLinks({
on: {
copy: (instance, eventTraget) => {
console.log(`Первым аргуметом в этой функции передается инстанс класса SharePageLinks, вот он:`, instance);
console.log(`Второй аргумент - элемент на котором сработало событие. Посмотри-ка на него:`, eventTarget);
},
},
});
MIT
FAQs
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
React disclosed a CVSS 10.0 RCE in React Server Components and is advising users to upgrade affected packages and frameworks to patched versions now.

Research
/Security News
We spotted a wave of auto-generated “elf-*” npm packages published every two minutes from new accounts, with simple malware variants and early takedowns underway.

Security News
TypeScript 6.0 will be the last JavaScript-based major release, as the project shifts to the TypeScript 7 native toolchain with major build speedups.