question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Read content & preferences from URL query string

See original GitHub issue

This would make sharing links to the page much easier.

For example, https://carbon.now.sh/?code=Hello%20world!&theme=blackboard would pre-fill the editor with “Hello world!” and apply the Blackboard theme. Everything else would fall back to the default settings, of course.

If this would be a welcome addition, I’ll open a PR for it.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
mfix22commented, Sep 30, 2017

I don’t think the content should be in the URL (: Open to loading the settings from URL params.

2reactions
andrewdacommented, Sep 30, 2017

For example,

const hello = () => {
  console.log('Hello World!');
}

(56 chars)

Encodes to: 堗臼铤⋆凃堜曚䙨㫐㖏橯圂Ⴃ㇝荆闌壷䅛鍅Ꮄ榋堑蒠総徖㽈䬥㧰穏 (29 chars)

Just for fun, I also tried encoding the server.js file (1077 chars). It encodes to:

堗臼铤ᴗ槣濵赆䙽㙹㾜唍㵦価䏕靀飅怙瀪䞌嵖駻盡脾飇圗▯䩎䲗⨫䰉炰䷍帙䀘吤飰祻搙赈䚢帒䒔⫮䵶凱န杄译愔苹䭄鲆ꇃ謕蜢飓夙➊䞌嵖駻盡茪黔㙞湼猎㶖燳㫠甼诘恳炢枬嵖駻盡蜾飔㙞湼⫮䵶傫怰着飏堒茼谬絇埒枝䫨劀㻘⡈㗏档㿁朠㬆闎怚▹Ⰾ衣轣栩蔦诓忷㾛甥譄ꃂ㮽⢜粀㛞疨ᚮ⏆ꇃ篭輲闎㧐✩橤㵇㦻⻕赆哅嶛⦳灊霆䆻怭躠蟐幰㖈㐌緧䞃鋡漪鲀擴棸鑍趗䝃䟅茨鋅㙞湸呮ᑦ憋瞩煂鯅怚㡘听洦凱䛤㩔賕嶑荺呍衧懳᧠眰蟎墖㾜殄═睡ሉ煈鯒嵰⠜猎㤂ᔓ㰌碠掞ᛐ▨ᖍᯖ馃埵誰飅延▼猎売饻᧱洰仅徙▯两═睡ݠ暠䚣帗䌛鏬祆觛䋠瓪碲䍓煨Ⰾ䵢溱ݠ暠ꏉឞ棢犎⎢駣濵蜢飅㩔燽Ⳍ終枡䫀ꄜ䚻ᛐ▸鑍趗䝃珵譌诒㙞湹啮⏆击猀硴⠠㙹羼甬綂騋珴眺闒娐自ᚮ泶騩䋤硴⠠㙹羼甬綂馛㰐皮嗁垗莽ᚥ桢槳㰄纠飅忴湯两ᯗᔁ怩焼諅彴䋙咅桧㥫猐暮嗁垗莽ᚥ㣐皱ݠ蒾䚩奰䋛鑎椢ᔓ㯹漪颀戒综⫬鲲ᒳ瀝肠铅抚Ꮘᖎ岷㧳㰈茮诔㩓爪歅桢槳㰄纠飅忴湯两ᯗᔁ怩焼諅彴䋙咅桧㥫猐暮喇㱐䋙咅起冋灄碲⠊㙐⩋詭鶦榋瀽祆讌㙺䋞䩌㴦䝃䏕躠跉怚Ꮘᖎ岷㧳㰈茮诔㩓烩诤⋆⥳㟱炲⠊㙐⩋詬㵆潣㯹潀闉嶚䌂橤⏖凳翵誼雏怚⠉豎淖爃矵誮劀垗罾偬㵧䅫漙筆闎㩽湻ⴍ糷䠑ݼ鄺袇㙾炫ᖎ䲗⨫䰉炰䵮㷴㺛狭沷㧙搱锲體夙➊䭡䛢Ⴃ珵譌诒㵶䂜铬終槣搩躸䚥徙▯两═睡ݠ朲貀㩲苼殄␆槳搼未飒ᛐ▨ᖌ嵖駻搑炼鋏姴㹏橪䲖⤣諡蔼䚨悚䉎汅鴦ꆻᦑ眾駔䍒䔜㐮䶇酡䩨暠ꏉឞ炢ɿ

(539 chars)

Read more comments on GitHub >

github_iconTop Results From Across the Web

A Beginner's Guide to URL Parameters - SEMrush
In this comprehensive guide, we explore the ins and outs of URL parameters. Discover now how to use query strings without hurting your ......
Read more >
How can I get query string values in JavaScript?
Just call var langval = $.urlParam('lang'); , and you've got it. UZBEKJON has a great blog post on this as well, Get URL...
Read more >
URL query string parameters in list and workflow criteria
Query string parameters are added to your website URLs when you use tracking URLs to track a visit from a certain source and...
Read more >
How to Get URL Parameters with JavaScript - SitePoint
Learn how to parse query string parameters and get their values in JavaScript. Use the results for tracking referrals, autocomplete, ...
Read more >
URL Query Parameters In GA | Search Discovery
All we have to do is navigate to Admin > View Settings > Exclude URL Query Parameters and type the query string in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found