René's URL Explorer Experiment


Title: Setting cookies? · uBlockO · Discussion #21 · GitHub

Open Graph Title: Setting cookies? · uBlockO · Discussion #21

X Title: Setting cookies? · uBlockO · Discussion #21

Description: Setting cookies?

Open Graph Description: Hi @uBlock-user, as you have scriplets to set local items and session items, could you also consider adding a scriplet that allows to set cookies on websites? This could be useful as it'd allow aut...

X Description: Hi @uBlock-user, as you have scriplets to set local items and session items, could you also consider adding a scriplet that allows to set cookies on websites? This could be useful as it'd allow...

Opengraph URL: https://github.com/orgs/uBlockO/discussions/21

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"QAPage","mainEntity":{"@type":"Question","name":"Setting cookies?","text":"

Hi @uBlock-user, as you have scriplets to set local items and session items, could you also consider adding a scriplet that allows to set cookies on websites? This could be useful as it'd allow automatically to force specific settings on websites or restore them if the browser cache has been emptied.

\n

One use case: if you set a cookie on Youtube https://www.youtube.com/ which Name is SOCS and Value is CAESEwgDEgk1MjE4NjcxMTIaAmVuIAEaBgiAl7ihBg, that would allow to skip the GDPR dialog automatically with the setting \"Reject all\".

\n
Details\n

\"kuva\"

\n
","upvoteCount":2,"answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"
/// setCookie.js\n// example.com##+js(setCookie, SOCS, CAESEwgDEgk1MjE4NjcxMTIaAmVuIAEaBgiAl7ihBg)\nfunction( \n\tcName = '', \n\tcValue = '',\n\texpTime = '',\n\tbehavior = '' \n) {\n\tlet timer = undefined;\n\tif ( cName === '' ) { return; }\n\tif ( expTime === '' ) { expTime = '1'; }\n\tif ( cValue === '' ) { cValue = '\"\"'; }\t\n\tconst setCookie = () => {\n\t\ttry {\n\t\t\tconst cookies = document.cookie;\n\t\t\tif ( !cookies.includes(cName) || !cookies.includes(cValue) ) {\n\t\t      \t\tconst date = new Date();\n\t\t\t\tdate.setTime(date.getTime() + (expTime * 24 * 60 * 60 * 1000));\n\t\t\t\tconst expires = \"expires=\" + date.toUTCString();\n\t\t\t\tdocument.cookie = cName + \"=\" + cValue + \"; \" + expires + \"; path=/\";\n\t\t\t} else { \n\t\t\t\treturn; \n\t\t\t}\t\n\t\t} catch { }\n\t};\n\tconst mutationHandler = mutations => {\n\tif ( timer !== undefined ) { return; }\n\tlet skip = true;\n\tfor ( let i = 0; i < mutations.length && skip; i++ ) {\n\t    const { type, addedNodes, removedNodes } = mutations[i];\n\t    if ( type === 'attributes' ) { skip = false; }\n\t    for ( let j = 0; j < addedNodes.length && skip; j++ ) {\n\t\tif ( addedNodes[j].nodeType === 1 ) { skip = false; break; }\n\t    }\n\t    for ( let j = 0; j < removedNodes.length && skip; j++ ) {\n\t\tif ( removedNodes[j].nodeType === 1 ) { skip = false; break; }\n\t    }\n\t}\n\tif ( skip ) { return; }\n\ttimer = self.requestIdleCallback(setCookie, { timeout: 10 });\n\t};\n\tconst start = ( ) => {\n\tsetCookie();\n\tif ( /\\bloop\\b/.test(behavior) === false ) { return; }\n\tconst observer = new MutationObserver(mutationHandler);\n\tobserver.observe(document.documentElement, {\n\t    attributes: true,\n\t    childList: true,\n\t    subtree: true,\n\t});\n\t};\n\tif ( document.readyState !== 'complete' && /\\bcomplete\\b/.test(behavior) ) {\n\tself.addEventListener('load', start, { once: true });\n\t} else if ( document.readyState !== 'loading' || /\\basap\\b/.test(behavior) ) {\n\tstart(); \n\t} else {\n\tself.addEventListener('DOMContentLoaded', start, { once: true });\n\t}\t\n}\n   \n
\n

@peace2000

","upvoteCount":1,"url":"https://github.com/orgs/uBlockO/discussions/21#discussioncomment-5551256"}}}

route-pattern/orgs/:org/discussions/:number(.:format)
route-controllerdiscussions
route-actionshow
fetch-noncev2:8f92fc0f-6115-7c36-45b6-3238fc5894e9
current-catalog-service-hash9f0abe34da433c9b6db74bffa2466494a717b579a96b30a5d252e5090baea7be
request-id9EA4:115553:D3555:114DB6:698E9E19
html-safe-nonce634bf6e221bb1048adbf8cfaaa189181815f2adb840eae2031182784828e4944
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RUE0OjExNTU1MzpEMzU1NToxMTREQjY6Njk4RTlFMTkiLCJ2aXNpdG9yX2lkIjoiOTA4ODU0NDA3NzM3NzM0NzA5NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacf78c1dbf77f49bf822ee1f3233b6ac12d1e437fbdd621e49d7a3d29786b2bf93
hovercard-subject-tagdiscussion:5052981
github-keyboard-shortcutsrepository,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///discussions/show
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/orgs/uBlockO/discussions/21
twitter:imagehttps://opengraph.githubassets.com/e0757ec7ac2b19ed38bb557714cf173a5d73b3d65d9e7bd681f60b77bbe29a05/orgs/uBlockO/discussions/21
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/e0757ec7ac2b19ed38bb557714cf173a5d73b3d65d9e7bd681f60b77bbe29a05/orgs/uBlockO/discussions/21
og:image:altHi @uBlock-user, as you have scriplets to set local items and session items, could you also consider adding a scriplet that allows to set cookies on websites? This could be useful as it'd allow aut...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonecb2828a801ee6b7be618f3ac76fbf55def35bbc30f053a9c41bf90210b8b72ba
turbo-cache-controlno-preview
octolytics-dimension-user_id148974853
octolytics-dimension-user_loginuBlockO
octolytics-dimension-repository_id89163410
octolytics-dimension-repository_nwouBlockO/uBO-Scriptlets
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id89163410
octolytics-dimension-repository_network_root_nwouBlockO/uBO-Scriptlets
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasee6b91a7e6e46287d26887e3fb7a4161657bab8f7
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/uBlockO/uBO-Scriptlets/discussions/21#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Forgs%2FuBlockO%2Fdiscussions%2F21
uBlockOhttps://patch-diff.githubusercontent.com/uBlockO
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Forgs%2FuBlockO%2Fdiscussions%2F21
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fdiscussions%2Fshow&source=header-repo&source_repo=uBlockO%2FuBO-Scriptlets
Reloadhttps://patch-diff.githubusercontent.com/uBlockO/uBO-Scriptlets/discussions/21
Reloadhttps://patch-diff.githubusercontent.com/uBlockO/uBO-Scriptlets/discussions/21
Reloadhttps://patch-diff.githubusercontent.com/uBlockO/uBO-Scriptlets/discussions/21
uBlockO https://patch-diff.githubusercontent.com/uBlockO
Overview https://patch-diff.githubusercontent.com/uBlockO
Repositories https://patch-diff.githubusercontent.com/orgs/uBlockO/repositories
Discussions https://patch-diff.githubusercontent.com/orgs/uBlockO/discussions
Projects https://patch-diff.githubusercontent.com/orgs/uBlockO/projects
Packages https://patch-diff.githubusercontent.com/orgs/uBlockO/packages
People https://patch-diff.githubusercontent.com/orgs/uBlockO/people
Overviewhttps://patch-diff.githubusercontent.com/uBlockO
Repositorieshttps://patch-diff.githubusercontent.com/orgs/uBlockO/repositories
Discussionshttps://patch-diff.githubusercontent.com/orgs/uBlockO/discussions
Projectshttps://patch-diff.githubusercontent.com/orgs/uBlockO/projects
Packageshttps://patch-diff.githubusercontent.com/orgs/uBlockO/packages
Peoplehttps://patch-diff.githubusercontent.com/orgs/uBlockO/people
Answered https://patch-diff.githubusercontent.com/uBlockO/uBO-Scriptlets/discussions/21#discussioncomment-5551256
uBlock-userhttps://patch-diff.githubusercontent.com/uBlock-user
peace2000 https://patch-diff.githubusercontent.com/peace2000
Q&Ahttps://patch-diff.githubusercontent.com/orgs/uBlockO/discussions/categories/q-a
Setting cookies? https://patch-diff.githubusercontent.com/uBlockO/uBO-Scriptlets/discussions/21#top
peace2000 https://patch-diff.githubusercontent.com/peace2000
Answered https://patch-diff.githubusercontent.com/uBlockO/uBO-Scriptlets/discussions/21#discussioncomment-5551256
uBlock-userhttps://patch-diff.githubusercontent.com/uBlock-user
Return to tophttps://patch-diff.githubusercontent.com/uBlockO/uBO-Scriptlets/discussions/21#top
Please reload this pagehttps://patch-diff.githubusercontent.com/uBlockO/uBO-Scriptlets/discussions/21
https://patch-diff.githubusercontent.com/uBlockO/uBO-Scriptlets/discussions/21
Please reload this pagehttps://patch-diff.githubusercontent.com/uBlockO/uBO-Scriptlets/discussions/21
https://patch-diff.githubusercontent.com/uBlockO/uBO-Scriptlets/discussions/21
peace2000 https://patch-diff.githubusercontent.com/peace2000
Apr 6, 2023 https://patch-diff.githubusercontent.com/uBlockO/uBO-Scriptlets/discussions/21#discussion-5052981
@uBlock-userhttps://github.com/uBlock-user
https://user-images.githubusercontent.com/17256841/230494050-d9ed7cb0-8996-4ed5-be03-a0e2db001e57.png
Give feedback.https://patch-diff.githubusercontent.com/uBlockO/uBO-Scriptlets/discussions/21
uBlock-user https://patch-diff.githubusercontent.com/uBlock-user
Apr 7, 2023 https://github.com/orgs/uBlockO/discussions/21#discussioncomment-5551256
View full answer https://patch-diff.githubusercontent.com/uBlockO/uBO-Scriptlets/discussions/21#discussioncomment-5551256
Oldest https://patch-diff.githubusercontent.com/orgs/uBlockO/discussions/21?sort=old
Newest https://patch-diff.githubusercontent.com/orgs/uBlockO/discussions/21?sort=new
Top https://patch-diff.githubusercontent.com/orgs/uBlockO/discussions/21?sort=top
Please reload this pagehttps://patch-diff.githubusercontent.com/uBlockO/uBO-Scriptlets/discussions/21
https://patch-diff.githubusercontent.com/uBlockO/uBO-Scriptlets/discussions/21
Please reload this pagehttps://patch-diff.githubusercontent.com/uBlockO/uBO-Scriptlets/discussions/21
https://patch-diff.githubusercontent.com/uBlockO/uBO-Scriptlets/discussions/21
uBlock-user https://patch-diff.githubusercontent.com/uBlock-user
Apr 7, 2023 https://patch-diff.githubusercontent.com/uBlockO/uBO-Scriptlets/discussions/21#discussioncomment-5551256
@peace2000https://github.com/peace2000
Give feedback.https://patch-diff.githubusercontent.com/uBlockO/uBO-Scriptlets/discussions/21
https://patch-diff.githubusercontent.com/uBlock-user
Please reload this pagehttps://patch-diff.githubusercontent.com/uBlockO/uBO-Scriptlets/discussions/21
https://patch-diff.githubusercontent.com/uBlockO/uBO-Scriptlets/discussions/21
uBlock-userhttps://patch-diff.githubusercontent.com/uBlock-user
Apr 8, 2023 https://patch-diff.githubusercontent.com/uBlockO/uBO-Scriptlets/discussions/21#discussioncomment-5559881
@peace2000https://github.com/peace2000
Give feedback.https://patch-diff.githubusercontent.com/uBlockO/uBO-Scriptlets/discussions/21
https://patch-diff.githubusercontent.com/uBlock-user
Please reload this pagehttps://patch-diff.githubusercontent.com/uBlockO/uBO-Scriptlets/discussions/21
https://patch-diff.githubusercontent.com/uBlockO/uBO-Scriptlets/discussions/21
uBlock-userhttps://patch-diff.githubusercontent.com/uBlock-user
Apr 8, 2023 https://patch-diff.githubusercontent.com/uBlockO/uBO-Scriptlets/discussions/21#discussioncomment-5559890
Give feedback.https://patch-diff.githubusercontent.com/uBlockO/uBO-Scriptlets/discussions/21
https://patch-diff.githubusercontent.com/peace2000
Please reload this pagehttps://patch-diff.githubusercontent.com/uBlockO/uBO-Scriptlets/discussions/21
https://patch-diff.githubusercontent.com/uBlockO/uBO-Scriptlets/discussions/21
Please reload this pagehttps://patch-diff.githubusercontent.com/uBlockO/uBO-Scriptlets/discussions/21
https://patch-diff.githubusercontent.com/uBlockO/uBO-Scriptlets/discussions/21
peace2000https://patch-diff.githubusercontent.com/peace2000
Apr 8, 2023 https://patch-diff.githubusercontent.com/uBlockO/uBO-Scriptlets/discussions/21#discussioncomment-5560002
https://www.google.fi/https://www.google.fi/
Give feedback.https://patch-diff.githubusercontent.com/uBlockO/uBO-Scriptlets/discussions/21
https://patch-diff.githubusercontent.com/uBlock-user
Please reload this pagehttps://patch-diff.githubusercontent.com/uBlockO/uBO-Scriptlets/discussions/21
https://patch-diff.githubusercontent.com/uBlockO/uBO-Scriptlets/discussions/21
uBlock-userhttps://patch-diff.githubusercontent.com/uBlock-user
Apr 8, 2023 https://patch-diff.githubusercontent.com/uBlockO/uBO-Scriptlets/discussions/21#discussioncomment-5560036
https://www.google.fi/https://www.google.fi/
Give feedback.https://patch-diff.githubusercontent.com/uBlockO/uBO-Scriptlets/discussions/21
https://patch-diff.githubusercontent.com/peace2000
Please reload this pagehttps://patch-diff.githubusercontent.com/uBlockO/uBO-Scriptlets/discussions/21
https://patch-diff.githubusercontent.com/uBlockO/uBO-Scriptlets/discussions/21
peace2000https://patch-diff.githubusercontent.com/peace2000
Apr 8, 2023 https://patch-diff.githubusercontent.com/uBlockO/uBO-Scriptlets/discussions/21#discussioncomment-5560055
Give feedback.https://patch-diff.githubusercontent.com/uBlockO/uBO-Scriptlets/discussions/21
uBlock-userhttps://patch-diff.githubusercontent.com/uBlock-user
Sign up for freehttps://patch-diff.githubusercontent.com/join?source=comment-repo
Sign in to commenthttps://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Forgs%2FuBlockO%2Fdiscussions%2F21
🙏 Q&A https://patch-diff.githubusercontent.com/orgs/uBlockO/discussions/categories/q-a
https://patch-diff.githubusercontent.com/peace2000
https://patch-diff.githubusercontent.com/uBlock-user
https://patch-diff.githubusercontent.com/uBlockO/uBO-Scriptlets/discussions/21
https://patch-diff.githubusercontent.com/settings/replies?return_to=1
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.