urlpurify 2.2.0 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +96 -45
- package/dist/clean.d.mts +1 -0
- package/dist/clean.mjs +56 -20
- package/dist/defaults.d.mts +7 -1
- package/dist/defaults.mjs +160 -3
- package/dist/index.d.mts +79 -4
- package/dist/index.mjs +79 -4
- package/dist/node_modules/entities/dist/decode-codepoint.mjs +2 -2
- package/dist/node_modules/entities/dist/decode.mjs +262 -247
- package/dist/node_modules/entities/dist/generated/decode-data-html.mjs +8 -4
- package/dist/node_modules/entities/dist/internal/decode-data-format.mjs +116 -0
- package/dist/node_modules/trousse/dist/is.mjs +7 -1
- package/dist/node_modules/trousse/dist/locales.mjs +21 -0
- package/dist/node_modules/trousse/dist/matching.mjs +23 -13
- package/dist/node_modules/trousse/dist/urls.mjs +203 -51
- package/dist/pathTarget.mjs +2 -2
- package/dist/tracking/clickAttribution.mjs +26 -1
- package/dist/tracking/housekeeping.mjs +13 -1
- package/dist/tracking/session.d.mts +2 -0
- package/dist/tracking/session.mjs +12 -0
- package/dist/types.d.mts +7 -1
- package/dist/unwraps/a8Net.mjs +1 -1
- package/dist/unwraps/acast.mjs +1 -1
- package/dist/unwraps/accesstrade.mjs +1 -1
- package/dist/unwraps/aceml.mjs +2 -2
- package/dist/unwraps/adcell.mjs +1 -1
- package/dist/unwraps/addThis.d.mts +2 -0
- package/dist/unwraps/addThis.mjs +17 -0
- package/dist/unwraps/addToAny.d.mts +2 -0
- package/dist/unwraps/addToAny.mjs +21 -0
- package/dist/unwraps/addToAnySubscribe.d.mts +2 -0
- package/dist/unwraps/addToAnySubscribe.mjs +8 -0
- package/dist/unwraps/addToMyYahoo.d.mts +2 -0
- package/dist/unwraps/addToMyYahoo.mjs +29 -0
- package/dist/unwraps/adfly.mjs +1 -1
- package/dist/unwraps/admitad.mjs +1 -1
- package/dist/unwraps/affilae.mjs +3 -1
- package/dist/unwraps/affiliatesOne.mjs +1 -1
- package/dist/unwraps/allblog.mjs +1 -1
- package/dist/unwraps/amazonAffiliate.mjs +5 -4
- package/dist/unwraps/amazonSes.mjs +2 -2
- package/dist/unwraps/ampCache.mjs +4 -3
- package/dist/unwraps/ampCacheImage.mjs +1 -1
- package/dist/unwraps/anchor.mjs +1 -1
- package/dist/unwraps/anonymouse.mjs +1 -1
- package/dist/unwraps/antennaPod.d.mts +2 -0
- package/dist/unwraps/antennaPod.mjs +15 -0
- package/dist/unwraps/anytimePlayer.d.mts +2 -0
- package/dist/unwraps/anytimePlayer.mjs +17 -0
- package/dist/unwraps/apptrkr.mjs +3 -2
- package/dist/unwraps/archiveToday.mjs +2 -2
- package/dist/unwraps/arquivo.mjs +1 -1
- package/dist/unwraps/arttrack.mjs +1 -1
- package/dist/unwraps/augure.mjs +3 -3
- package/dist/unwraps/awesound.mjs +1 -1
- package/dist/unwraps/axigen.mjs +2 -1
- package/dist/unwraps/bacLacWebArchive.mjs +1 -1
- package/dist/unwraps/bananatag.mjs +1 -1
- package/dist/unwraps/big5Gate.mjs +1 -1
- package/dist/unwraps/bing.mjs +7 -7
- package/dist/unwraps/bingAds.mjs +4 -4
- package/dist/unwraps/bitrix.mjs +2 -1
- package/dist/unwraps/bitrixBanner.mjs +2 -1
- package/dist/unwraps/blinkList.d.mts +2 -0
- package/dist/unwraps/blinkList.mjs +8 -0
- package/dist/unwraps/bloggerBlogThis.d.mts +2 -0
- package/dist/unwraps/bloggerBlogThis.mjs +16 -0
- package/dist/unwraps/bloggerImageProxy.mjs +2 -1
- package/dist/unwraps/bloglines.d.mts +2 -0
- package/dist/unwraps/bloglines.mjs +21 -0
- package/dist/unwraps/bridgyFed.mjs +1 -1
- package/dist/unwraps/buffer.d.mts +2 -0
- package/dist/unwraps/buffer.mjs +23 -0
- package/dist/unwraps/buybox.mjs +1 -1
- package/dist/unwraps/buzzstream.mjs +1 -1
- package/dist/unwraps/cake.mjs +2 -2
- package/dist/unwraps/checkPointHarmony.mjs +2 -2
- package/dist/unwraps/cjNetwork.mjs +3 -3
- package/dist/unwraps/claritas.mjs +2 -2
- package/dist/unwraps/cleverbridge.mjs +3 -3
- package/dist/unwraps/cloudhq.mjs +1 -1
- package/dist/unwraps/cloze.mjs +1 -1
- package/dist/unwraps/cohst.mjs +1 -1
- package/dist/unwraps/contactMonkey.mjs +3 -2
- package/dist/unwraps/convertiser.mjs +1 -1
- package/dist/unwraps/cse360.mjs +1 -1
- package/dist/unwraps/dasBlog.mjs +1 -1
- package/dist/unwraps/datalifeEngine.mjs +5 -4
- package/dist/unwraps/delicious.d.mts +2 -0
- package/dist/unwraps/delicious.mjs +15 -0
- package/dist/unwraps/deployer.mjs +3 -3
- package/dist/unwraps/derefMail.mjs +4 -3
- package/dist/unwraps/deviantartOutgoing.mjs +1 -1
- package/dist/unwraps/diasporaShare.d.mts +2 -0
- package/dist/unwraps/diasporaShare.mjs +16 -0
- package/dist/unwraps/diggSubmit.d.mts +2 -0
- package/dist/unwraps/diggSubmit.mjs +11 -0
- package/dist/unwraps/digikala.mjs +3 -3
- package/dist/unwraps/diigoPost.d.mts +2 -0
- package/dist/unwraps/diigoPost.mjs +12 -0
- package/dist/unwraps/disqus.mjs +2 -1
- package/dist/unwraps/drupalOembed.mjs +3 -5
- package/dist/unwraps/dstats.mjs +2 -2
- package/dist/unwraps/eClick.mjs +1 -1
- package/dist/unwraps/easyMarketing.mjs +3 -3
- package/dist/unwraps/ebayRover.mjs +1 -1
- package/dist/unwraps/ebuzzing.mjs +1 -1
- package/dist/unwraps/edgepilot.mjs +1 -1
- package/dist/unwraps/effiliation.mjs +1 -1
- package/dist/unwraps/elasticEmail.mjs +3 -2
- package/dist/unwraps/epn.mjs +1 -1
- package/dist/unwraps/eulerian.mjs +1 -1
- package/dist/unwraps/evernoteClip.d.mts +2 -0
- package/dist/unwraps/evernoteClip.mjs +8 -0
- package/dist/unwraps/exciteTranslate.mjs +1 -1
- package/dist/unwraps/facebook.mjs +1 -1
- package/dist/unwraps/facebookShare.d.mts +2 -0
- package/dist/unwraps/facebookShare.mjs +25 -0
- package/dist/unwraps/feed2js.d.mts +2 -0
- package/dist/unwraps/feed2js.mjs +16 -0
- package/dist/unwraps/feedStatistics.mjs +2 -2
- package/dist/unwraps/feedValidator.d.mts +2 -0
- package/dist/unwraps/feedValidator.mjs +12 -0
- package/dist/unwraps/feedblitz.mjs +4 -5
- package/dist/unwraps/feedland.d.mts +2 -0
- package/dist/unwraps/feedland.mjs +12 -0
- package/dist/unwraps/feedly.d.mts +2 -0
- package/dist/unwraps/feedly.mjs +28 -0
- package/dist/unwraps/feedsportal.mjs +1 -1
- package/dist/unwraps/finalsite.mjs +2 -2
- package/dist/unwraps/firebaseDynamicLinks.mjs +3 -2
- package/dist/unwraps/firstory.mjs +3 -3
- package/dist/unwraps/fiveByFive.mjs +2 -2
- package/dist/unwraps/flattrSubmit.d.mts +2 -0
- package/dist/unwraps/flattrSubmit.mjs +8 -0
- package/dist/unwraps/flipboardShare.d.mts +2 -0
- package/dist/unwraps/flipboardShare.mjs +15 -0
- package/dist/unwraps/fortimail.mjs +3 -2
- package/dist/unwraps/friendFeed.d.mts +2 -0
- package/dist/unwraps/friendFeed.mjs +18 -0
- package/dist/unwraps/gabCompose.d.mts +2 -0
- package/dist/unwraps/gabCompose.mjs +8 -0
- package/dist/unwraps/genericCarrier.d.mts +2 -0
- package/dist/unwraps/genericCarrier.mjs +31 -0
- package/dist/unwraps/gfnLinkProxy.mjs +3 -3
- package/dist/unwraps/godcaster.mjs +2 -2
- package/dist/unwraps/googleAmpViewer.mjs +2 -2
- package/dist/unwraps/googleBookmarks.d.mts +2 -0
- package/dist/unwraps/googleBookmarks.mjs +8 -0
- package/dist/unwraps/googleBuzz.d.mts +2 -0
- package/dist/unwraps/googleBuzz.mjs +8 -0
- package/dist/unwraps/googleNewsModern.mjs +2 -3
- package/dist/unwraps/googlePlusShare.d.mts +2 -0
- package/dist/unwraps/googlePlusShare.mjs +11 -0
- package/dist/unwraps/googlePodcasts.d.mts +2 -0
- package/dist/unwraps/googlePodcasts.mjs +27 -0
- package/dist/unwraps/googleReader.d.mts +2 -0
- package/dist/unwraps/googleReader.mjs +20 -0
- package/dist/unwraps/googleTranslate.mjs +13 -13
- package/dist/unwraps/govdelivery.mjs +3 -2
- package/dist/unwraps/hackerNewsSubmit.d.mts +2 -0
- package/dist/unwraps/hackerNewsSubmit.mjs +8 -0
- package/dist/unwraps/hasoffers.mjs +3 -2
- package/dist/unwraps/hatenaBookmark.d.mts +2 -0
- package/dist/unwraps/hatenaBookmark.mjs +22 -0
- package/dist/unwraps/hirkereso.mjs +1 -1
- package/dist/unwraps/horde.mjs +1 -1
- package/dist/unwraps/hubspotSidekick.mjs +1 -1
- package/dist/unwraps/impact.mjs +2 -2
- package/dist/unwraps/indexHu.mjs +2 -1
- package/dist/unwraps/inoreader.d.mts +2 -0
- package/dist/unwraps/inoreader.mjs +22 -0
- package/dist/unwraps/instapaperSave.d.mts +2 -0
- package/dist/unwraps/instapaperSave.mjs +11 -0
- package/dist/unwraps/invisionNoExternalLinks.mjs +1 -1
- package/dist/unwraps/involveAsia.mjs +1 -1
- package/dist/unwraps/jive.mjs +2 -1
- package/dist/unwraps/klook.mjs +2 -1
- package/dist/unwraps/lazada.mjs +1 -1
- package/dist/unwraps/letscast.mjs +1 -1
- package/dist/unwraps/lineShare.d.mts +2 -0
- package/dist/unwraps/lineShare.mjs +25 -0
- package/dist/unwraps/linkA.mjs +1 -1
- package/dist/unwraps/linkedin.mjs +1 -1
- package/dist/unwraps/linkedinShare.d.mts +2 -0
- package/dist/unwraps/linkedinShare.mjs +15 -0
- package/dist/unwraps/linksynergy.mjs +2 -2
- package/dist/unwraps/linktrust.mjs +3 -3
- package/dist/unwraps/linkwise.mjs +1 -1
- package/dist/unwraps/livedoorReader.d.mts +2 -0
- package/dist/unwraps/livedoorReader.mjs +12 -0
- package/dist/unwraps/locWebArchive.mjs +1 -1
- package/dist/unwraps/locaweb.mjs +3 -1
- package/dist/unwraps/logicboard.mjs +1 -1
- package/dist/unwraps/magellan.mjs +1 -1
- package/dist/unwraps/mail2easy.mjs +1 -1
- package/dist/unwraps/mailchimp.mjs +1 -1
- package/dist/unwraps/mailinblack.mjs +6 -4
- package/dist/unwraps/mailstat.mjs +1 -1
- package/dist/unwraps/mailtrack.mjs +1 -1
- package/dist/unwraps/mandrill.mjs +3 -3
- package/dist/unwraps/medium.mjs +5 -5
- package/dist/unwraps/meneameSubmit.d.mts +2 -0
- package/dist/unwraps/meneameSubmit.mjs +11 -0
- package/dist/unwraps/meweShare.d.mts +2 -0
- package/dist/unwraps/meweShare.mjs +8 -0
- package/dist/unwraps/mimecast.mjs +1 -1
- package/dist/unwraps/ministryCloud.mjs +1 -1
- package/dist/unwraps/mintDownloads.mjs +1 -1
- package/dist/unwraps/mintFeeder.mjs +3 -2
- package/dist/unwraps/mohtwize.mjs +6 -4
- package/dist/unwraps/morss.d.mts +2 -0
- package/dist/unwraps/morss.mjs +13 -0
- package/dist/unwraps/mozillaOutgoing.mjs +3 -3
- package/dist/unwraps/myAolFeeds.d.mts +2 -0
- package/dist/unwraps/myAolFeeds.mjs +8 -0
- package/dist/unwraps/narrativ.mjs +1 -1
- package/dist/unwraps/natlibNz.mjs +1 -1
- package/dist/unwraps/ncls.mjs +2 -1
- package/dist/unwraps/ndlWarp.mjs +2 -2
- package/dist/unwraps/netaffiliation.mjs +1 -1
- package/dist/unwraps/netvibes.d.mts +2 -0
- package/dist/unwraps/netvibes.mjs +7 -0
- package/dist/unwraps/newsGator.d.mts +2 -0
- package/dist/unwraps/newsGator.mjs +17 -0
- package/dist/unwraps/newswire.mjs +3 -3
- package/dist/unwraps/nicoMs.mjs +1 -1
- package/dist/unwraps/nimble.mjs +1 -1
- package/dist/unwraps/nlaWebarchive.mjs +3 -3
- package/dist/unwraps/okRu.mjs +3 -2
- package/dist/unwraps/okShare.d.mts +2 -0
- package/dist/unwraps/okShare.mjs +23 -0
- package/dist/unwraps/op3.mjs +1 -1
- package/dist/unwraps/outlookSafelinks.mjs +1 -1
- package/dist/unwraps/pageflakes.d.mts +2 -0
- package/dist/unwraps/pageflakes.mjs +8 -0
- package/dist/unwraps/pagefreezer.mjs +2 -2
- package/dist/unwraps/partnerAds.mjs +2 -2
- package/dist/unwraps/pbs.mjs +1 -1
- package/dist/unwraps/pinterestPin.d.mts +2 -0
- package/dist/unwraps/pinterestPin.mjs +85 -0
- package/dist/unwraps/pipedrive.mjs +1 -1
- package/dist/unwraps/playerFm.d.mts +2 -0
- package/dist/unwraps/playerFm.mjs +16 -0
- package/dist/unwraps/pocketSave.d.mts +2 -0
- package/dist/unwraps/pocketSave.mjs +15 -0
- package/dist/unwraps/podcastAddict.d.mts +2 -0
- package/dist/unwraps/podcastAddict.mjs +14 -0
- package/dist/unwraps/podcastReady.d.mts +2 -0
- package/dist/unwraps/podcastReady.mjs +8 -0
- package/dist/unwraps/podcorn.mjs +1 -1
- package/dist/unwraps/podkite.mjs +1 -1
- package/dist/unwraps/podscribe.mjs +1 -1
- package/dist/unwraps/podsights.mjs +1 -1
- package/dist/unwraps/podup.mjs +2 -3
- package/dist/unwraps/postAffiliatePro.mjs +1 -1
- package/dist/unwraps/postmark.mjs +1 -1
- package/dist/unwraps/prNewswire.mjs +2 -2
- package/dist/unwraps/prezly.mjs +1 -1
- package/dist/unwraps/proofpointV2.mjs +1 -1
- package/dist/unwraps/proofpointV3.mjs +3 -3
- package/dist/unwraps/prweb.mjs +2 -2
- package/dist/unwraps/prxPlayer.d.mts +2 -0
- package/dist/unwraps/prxPlayer.mjs +16 -0
- package/dist/unwraps/qqMailReader.d.mts +2 -0
- package/dist/unwraps/qqMailReader.mjs +8 -0
- package/dist/unwraps/qualityClick.mjs +4 -3
- package/dist/unwraps/qzoneShare.d.mts +2 -0
- package/dist/unwraps/qzoneShare.mjs +8 -0
- package/dist/unwraps/rakutenAffiliate.mjs +3 -3
- package/dist/unwraps/redditOut.mjs +1 -1
- package/dist/unwraps/redditSubmit.d.mts +2 -0
- package/dist/unwraps/redditSubmit.mjs +19 -0
- package/dist/unwraps/researchgate.mjs +1 -1
- package/dist/unwraps/reviveAdserver.mjs +4 -4
- package/dist/unwraps/rssBoardValidator.d.mts +2 -0
- package/dist/unwraps/rssBoardValidator.mjs +8 -0
- package/dist/unwraps/salesdoubler.mjs +1 -1
- package/dist/unwraps/saleshandy.mjs +1 -1
- package/dist/unwraps/segmentfault.mjs +2 -2
- package/dist/unwraps/serendipity.mjs +4 -4
- package/dist/unwraps/shareaholic.d.mts +2 -0
- package/dist/unwraps/shareaholic.mjs +12 -0
- package/dist/unwraps/slashdotBookmark.d.mts +2 -0
- package/dist/unwraps/slashdotBookmark.mjs +11 -0
- package/dist/unwraps/smartredirect.mjs +1 -1
- package/dist/unwraps/sophos.mjs +2 -2
- package/dist/unwraps/soundOn.mjs +1 -1
- package/dist/unwraps/stay22.mjs +1 -1
- package/dist/unwraps/streamsend.mjs +1 -1
- package/dist/unwraps/stumbleuponSubmit.d.mts +2 -0
- package/dist/unwraps/stumbleuponSubmit.mjs +14 -0
- package/dist/unwraps/subscribeByEmail.d.mts +2 -0
- package/dist/unwraps/subscribeByEmail.mjs +10 -0
- package/dist/unwraps/subscribeOnAndroid.d.mts +2 -0
- package/dist/unwraps/subscribeOnAndroid.mjs +10 -0
- package/dist/unwraps/subscribeRu.mjs +1 -1
- package/dist/unwraps/substack.mjs +2 -3
- package/dist/unwraps/surly.mjs +1 -1
- package/dist/unwraps/swap.mjs +1 -1
- package/dist/unwraps/symantecClicktime.mjs +1 -1
- package/dist/unwraps/symplicity.mjs +1 -1
- package/dist/unwraps/teacup.mjs +3 -2
- package/dist/unwraps/technoratiFaves.d.mts +2 -0
- package/dist/unwraps/technoratiFaves.mjs +10 -0
- package/dist/unwraps/telegramShare.d.mts +2 -0
- package/dist/unwraps/telegramShare.mjs +18 -0
- package/dist/unwraps/theRegister.mjs +1 -1
- package/dist/unwraps/threadsIntent.d.mts +2 -0
- package/dist/unwraps/threadsIntent.mjs +16 -0
- package/dist/unwraps/toucharcade.mjs +1 -1
- package/dist/unwraps/tracdelight.mjs +3 -2
- package/dist/unwraps/trxHub.mjs +1 -1
- package/dist/unwraps/tumblrShare.d.mts +2 -0
- package/dist/unwraps/tumblrShare.mjs +13 -0
- package/dist/unwraps/twitterIntent.d.mts +2 -0
- package/dist/unwraps/twitterIntent.mjs +17 -0
- package/dist/unwraps/twoCheckout.mjs +4 -3
- package/dist/unwraps/ukWebArchive.mjs +1 -1
- package/dist/unwraps/ukgwa.mjs +1 -1
- package/dist/unwraps/unescoWebArchive.mjs +1 -1
- package/dist/unwraps/unisender.mjs +4 -4
- package/dist/unwraps/upAudio.mjs +1 -1
- package/dist/unwraps/vadeSecure.mjs +1 -1
- package/dist/unwraps/valuePress.mjs +2 -2
- package/dist/unwraps/vanilla.mjs +1 -1
- package/dist/unwraps/vbulletin.mjs +1 -1
- package/dist/unwraps/vefsafn.mjs +2 -2
- package/dist/unwraps/vgWort.mjs +1 -1
- package/dist/unwraps/vkShare.d.mts +2 -0
- package/dist/unwraps/vkShare.mjs +16 -0
- package/dist/unwraps/vocus.mjs +1 -1
- package/dist/unwraps/voxnest.mjs +1 -1
- package/dist/unwraps/w3cFeedValidator.d.mts +2 -0
- package/dist/unwraps/w3cFeedValidator.mjs +8 -0
- package/dist/unwraps/webArchive.mjs +5 -5
- package/dist/unwraps/webcitation.mjs +1 -1
- package/dist/unwraps/webharvest.mjs +1 -1
- package/dist/unwraps/weiboShare.d.mts +2 -0
- package/dist/unwraps/weiboShare.mjs +8 -0
- package/dist/unwraps/weserv.mjs +2 -2
- package/dist/unwraps/wikizero.mjs +2 -2
- package/dist/unwraps/windowsLive.d.mts +2 -0
- package/dist/unwraps/windowsLive.mjs +13 -0
- package/dist/unwraps/windowsLiveFavorites.d.mts +2 -0
- package/dist/unwraps/windowsLiveFavorites.mjs +8 -0
- package/dist/unwraps/worldNomads.mjs +2 -1
- package/dist/unwraps/wpPoczta.mjs +2 -2
- package/dist/unwraps/wykop.d.mts +2 -0
- package/dist/unwraps/wykop.mjs +11 -0
- package/dist/unwraps/xengentr.mjs +4 -3
- package/dist/unwraps/xianguo.d.mts +2 -0
- package/dist/unwraps/xianguo.mjs +8 -0
- package/dist/unwraps/xiaoyuzhou.mjs +1 -1
- package/dist/unwraps/ximalaya.mjs +3 -3
- package/dist/unwraps/xingShare.d.mts +2 -0
- package/dist/unwraps/xingShare.mjs +16 -0
- package/dist/unwraps/yahooBookmarks.d.mts +2 -0
- package/dist/unwraps/yahooBookmarks.mjs +38 -0
- package/dist/unwraps/yahooJapan.mjs +2 -3
- package/dist/unwraps/yahooJapanAmpViewer.mjs +2 -2
- package/dist/unwraps/yahooMailImage.mjs +2 -1
- package/dist/unwraps/yahooSearch.mjs +2 -2
- package/dist/unwraps/yamm.mjs +2 -1
- package/dist/unwraps/yandexMail.mjs +4 -3
- package/dist/unwraps/yandexTranslate.mjs +1 -1
- package/dist/unwraps/yandexTurbo.mjs +4 -4
- package/dist/unwraps/yesware.mjs +2 -2
- package/dist/unwraps/yourMembership.mjs +3 -2
- package/dist/unwraps/zencastr.mjs +1 -1
- package/dist/unwraps/zix.mjs +1 -1
- package/dist/unwraps/zscalerIsolation.mjs +1 -1
- package/dist/utils.mjs +9 -42
- package/package.json +4 -4
- package/dist/node_modules/entities/dist/internal/bin-trie-flags.mjs +0 -50
- package/dist/node_modules/entities/dist/internal/decode-shared.mjs +0 -143
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { isAnyOf } from "../node_modules/trousse/dist/matching.mjs";
|
|
2
|
+
import { isHostOf, isHttpUrl, parseUrl } from "../node_modules/trousse/dist/urls.mjs";
|
|
3
|
+
import { getParamTarget } from "../utils.mjs";
|
|
4
|
+
// src/unwraps/friendFeed.ts
|
|
5
|
+
const hosts = ["friendfeed.com", "www.friendfeed.com"];
|
|
6
|
+
const unwrapFriendFeed = (url) => {
|
|
7
|
+
if (!isHostOf(url, hosts)) return;
|
|
8
|
+
if (isAnyOf(url.pathname, "/share")) return getParamTarget(url, "url") ?? getParamTarget(url, "link");
|
|
9
|
+
if (isAnyOf(url.pathname, "/share/bookmarklet/frame")) {
|
|
10
|
+
const fragment = parseUrl(`?${url.hash.slice(1)}`, url);
|
|
11
|
+
if (!fragment) return;
|
|
12
|
+
return getParamTarget(fragment, "url");
|
|
13
|
+
}
|
|
14
|
+
if (url.pathname !== "/") return;
|
|
15
|
+
const target = getParamTarget(url, "url");
|
|
16
|
+
if (target && isHttpUrl(target)) return target;
|
|
17
|
+
};
|
|
18
|
+
export { unwrapFriendFeed };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { isAnyOf } from "../node_modules/trousse/dist/matching.mjs";
|
|
2
|
+
import { decodeEncodedScheme, decodeParamValue } from "../utils.mjs";
|
|
3
|
+
// src/unwraps/genericCarrier.ts
|
|
4
|
+
const httpTargetRegex = /^https?:\/\//i;
|
|
5
|
+
const carriers = [
|
|
6
|
+
"url",
|
|
7
|
+
"feedurl",
|
|
8
|
+
"moduleurl",
|
|
9
|
+
"feed.url",
|
|
10
|
+
".url",
|
|
11
|
+
"link",
|
|
12
|
+
"redirect",
|
|
13
|
+
"to",
|
|
14
|
+
"go",
|
|
15
|
+
"goto",
|
|
16
|
+
"out"
|
|
17
|
+
];
|
|
18
|
+
const unwrapGenericCarrier = (url) => {
|
|
19
|
+
const params = url.search.slice(1).split("&");
|
|
20
|
+
for (const [index, param] of params.entries()) {
|
|
21
|
+
const separator = param.indexOf("=");
|
|
22
|
+
if (separator === -1 || !isAnyOf(param.slice(0, separator), carriers)) continue;
|
|
23
|
+
const raw = param.slice(separator + 1);
|
|
24
|
+
let target = decodeEncodedScheme(decodeParamValue(raw));
|
|
25
|
+
if (!httpTargetRegex.test(target)) continue;
|
|
26
|
+
if (httpTargetRegex.test(raw) && raw.includes("?")) target = decodeParamValue([raw, ...params.slice(index + 1)].join("&"));
|
|
27
|
+
if (target.includes("#")) return target;
|
|
28
|
+
return `${target}${url.hash}`;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
export { unwrapGenericCarrier };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { isHttpUrl } from "../node_modules/trousse/dist/urls.mjs";
|
|
2
|
-
import {
|
|
1
|
+
import { decodeBase64, isHttpUrl } from "../node_modules/trousse/dist/urls.mjs";
|
|
2
|
+
import { getParamValues } from "../utils.mjs";
|
|
3
3
|
// src/unwraps/gfnLinkProxy.ts
|
|
4
|
-
const pathRegex = /^(?:\/[^/]+)?\/redirect
|
|
4
|
+
const pathRegex = /^(?:\/[^/]+)?\/redirect\/?$/i;
|
|
5
5
|
const unwrapGfnLinkProxy = (url) => {
|
|
6
6
|
if (!pathRegex.test(url.pathname)) return;
|
|
7
7
|
const raw = getParamValues(url, "to").at(0);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { decodePercent, isHostOf } from "../node_modules/trousse/dist/urls.mjs";
|
|
2
2
|
import { createParamExtractor } from "../utils.mjs";
|
|
3
3
|
// src/unwraps/godcaster.ts
|
|
4
|
-
const episodePrefixRegex = /^\/act\/e\/\d+\/\d+\/\d
|
|
4
|
+
const episodePrefixRegex = /^\/act\/e\/\d+\/\d+\/\d+\//i;
|
|
5
5
|
const encodedSchemeRegex = /^https?%(?:25)?3A/i;
|
|
6
|
-
const supportPathRegex = /^\/act\/(?:sr\/\d+|fr\/\d+\/\d+)
|
|
6
|
+
const supportPathRegex = /^\/act\/(?:sr\/\d+|fr\/\d+\/\d+)$/i;
|
|
7
7
|
const extractSupportTarget = createParamExtractor({
|
|
8
8
|
hosts: "go.godcaster.fm",
|
|
9
9
|
params: ["d"]
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { decodePercent } from "../node_modules/trousse/dist/urls.mjs";
|
|
2
2
|
// src/unwraps/googleAmpViewer.ts
|
|
3
3
|
const googleAmpHostRegex = /^(?:www\.)?google\.(?:com|[a-z]{2,3}(?:\.[a-z]{2,3})?)$/;
|
|
4
|
-
const httpsPathRegex = /^\/amp\/s\/(.+)
|
|
5
|
-
const httpPathRegex = /^\/amp\/(?!s\/)(.+)
|
|
4
|
+
const httpsPathRegex = /^\/amp\/s\/(.+)$/i;
|
|
5
|
+
const httpPathRegex = /^\/amp\/(?!s\/)(.+)$/i;
|
|
6
6
|
const unwrapGoogleAmpViewer = (url) => {
|
|
7
7
|
if (!googleAmpHostRegex.test(url.hostname)) return;
|
|
8
8
|
const httpsMatch = url.pathname.match(httpsPathRegex);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createParamExtractor } from "../utils.mjs";
|
|
2
|
+
// src/unwraps/googleBookmarks.ts
|
|
3
|
+
const unwrapGoogleBookmarks = createParamExtractor({
|
|
4
|
+
hosts: ["google.com", "www.google.com"],
|
|
5
|
+
path: "/bookmarks/mark",
|
|
6
|
+
params: ["bkmk"]
|
|
7
|
+
});
|
|
8
|
+
export { unwrapGoogleBookmarks };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { isHostOf } from "../node_modules/trousse/dist/urls.mjs";
|
|
2
|
-
import { decodeBase64UrlBinary } from "../utils.mjs";
|
|
1
|
+
import { decodeBase64UrlBinary, isHostOf } from "../node_modules/trousse/dist/urls.mjs";
|
|
3
2
|
// src/unwraps/googleNewsModern.ts
|
|
4
|
-
const articleIdRegex = /^\/(?:rss\/)?articles\/([\w-]+)
|
|
3
|
+
const articleIdRegex = /^\/(?:rss\/)?articles\/([\w-]+)/i;
|
|
5
4
|
const protobufFramingRegex = /\x08\x13".+?(https?:\/\/[^\xd2]+)\xd2\x01/;
|
|
6
5
|
const unwrapGoogleNewsModern = (url) => {
|
|
7
6
|
if (!isHostOf(url, "news.google.com")) return;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { isAnyOf } from "../node_modules/trousse/dist/matching.mjs";
|
|
2
|
+
import { isHostOf } from "../node_modules/trousse/dist/urls.mjs";
|
|
3
|
+
import { getParamTarget } from "../utils.mjs";
|
|
4
|
+
// src/unwraps/googlePlusShare.ts
|
|
5
|
+
const hosts = ["plus.google.com"];
|
|
6
|
+
const pathRegex = /^\/(?:u\/\d+\/)?share$/i;
|
|
7
|
+
const unwrapGooglePlusShare = (url) => {
|
|
8
|
+
if (!isHostOf(url, hosts) || !isAnyOf(url.pathname, pathRegex)) return;
|
|
9
|
+
return getParamTarget(url, "url");
|
|
10
|
+
};
|
|
11
|
+
export { unwrapGooglePlusShare };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { decodeBase64Url, decodeBase64UrlBinary, decodePercent, isHostOf, isHttpUrl, isUtf8Binary } from "../node_modules/trousse/dist/urls.mjs";
|
|
2
|
+
import { isAnyOf } from "../node_modules/trousse/dist/matching.mjs";
|
|
3
|
+
import { getParamValues } from "../utils.mjs";
|
|
4
|
+
// src/unwraps/googlePodcasts.ts
|
|
5
|
+
const showPathRegex = /^\/(?:u\/\d+\/)?feed\/([\w%=-]+)(?:\/episode\/[\w%=-]+)?\/?$/i;
|
|
6
|
+
const appHosts = ["podcasts.google.com"];
|
|
7
|
+
const appPaths = ["/", "/subscribe-by-rss-feed"];
|
|
8
|
+
const searchHosts = ["google.com", "www.google.com"];
|
|
9
|
+
const getEncodedFeed = (url) => {
|
|
10
|
+
if (isHostOf(url, appHosts)) {
|
|
11
|
+
const showMatch = url.pathname.match(showPathRegex);
|
|
12
|
+
if (showMatch) return decodePercent(showMatch[1]);
|
|
13
|
+
}
|
|
14
|
+
const isApp = isHostOf(url, appHosts) && isAnyOf(url.pathname, appPaths);
|
|
15
|
+
const isSearch = isHostOf(url, searchHosts) && isAnyOf(url.pathname, "/podcasts");
|
|
16
|
+
if (!isApp && !isSearch) return;
|
|
17
|
+
return getParamValues(url, "feed").at(0);
|
|
18
|
+
};
|
|
19
|
+
const unwrapGooglePodcasts = (url) => {
|
|
20
|
+
const encoded = getEncodedFeed(url);
|
|
21
|
+
if (!encoded) return;
|
|
22
|
+
const binary = decodeBase64UrlBinary(encoded);
|
|
23
|
+
if (binary === void 0 || !isUtf8Binary(binary)) return;
|
|
24
|
+
const decoded = decodeBase64Url(encoded);
|
|
25
|
+
if (decoded && isHttpUrl(decoded)) return decoded;
|
|
26
|
+
};
|
|
27
|
+
export { unwrapGooglePodcasts };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { decodePercent, isHostOf, isHttpUrl } from "../node_modules/trousse/dist/urls.mjs";
|
|
2
|
+
import { isAnyOf } from "../node_modules/trousse/dist/matching.mjs";
|
|
3
|
+
import { decodeEncodedScheme, getParamTarget } from "../utils.mjs";
|
|
4
|
+
import { googleHostRegex } from "./google.mjs";
|
|
5
|
+
// src/unwraps/googleReader.ts
|
|
6
|
+
const feedPathRegex = /^\/reader\/(?:view|m\/view|lite|preview\/\*)\/feed\/(?<target>.+)$/i;
|
|
7
|
+
const addPathRegex = /^\/ig\/(?:add|addtoreader)$/i;
|
|
8
|
+
const hosts = ["fusion.google.com"];
|
|
9
|
+
const unwrapGoogleReader = (url) => {
|
|
10
|
+
if (!isAnyOf(url.hostname, googleHostRegex)) return;
|
|
11
|
+
const match = url.pathname.match(feedPathRegex);
|
|
12
|
+
if (match?.groups) {
|
|
13
|
+
const target = decodeEncodedScheme(decodePercent(match.groups.target));
|
|
14
|
+
if (!isHttpUrl(target)) return;
|
|
15
|
+
return target;
|
|
16
|
+
}
|
|
17
|
+
if (!(isAnyOf(url.pathname, addPathRegex) || isHostOf(url, hosts) && isAnyOf(url.pathname, "/add"))) return;
|
|
18
|
+
return getParamTarget(url, "feedurl");
|
|
19
|
+
};
|
|
20
|
+
export { unwrapGoogleReader };
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { getQueryParam, getSubdomain, isHostOf } from "../node_modules/trousse/dist/urls.mjs";
|
|
2
|
+
import { isAnyOf, startsWithAnyOf } from "../node_modules/trousse/dist/matching.mjs";
|
|
3
3
|
import { getParamValues } from "../utils.mjs";
|
|
4
4
|
// src/unwraps/googleTranslate.ts
|
|
5
5
|
const googleTranslateHostRegex = /^(?:www\.)?translate\.google\.(?:com|[a-z]{2,3}(?:\.[a-z]{2,3})?)$/;
|
|
6
6
|
const googleTranslatePaths = ["/translate", "/website"];
|
|
7
|
-
const
|
|
7
|
+
const proxyDomains = ["translate.goog"];
|
|
8
|
+
const proxyParamPrefix = "_x_tr_";
|
|
8
9
|
const proxyLabelRegex = /^[a-z0-9-]+$/;
|
|
9
10
|
const hashedLabelRegex = /^[a-z2-7]{26}-[a-z0-9]{15}-/;
|
|
10
|
-
const
|
|
11
|
+
const singleDashRegex = /\b-\b/g;
|
|
11
12
|
const unwrapWebsiteProxy = (url) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
let prefix = `${url.searchParams.get(`${proxyParamPrefix}hp`) ?? ""}${label}`;
|
|
13
|
+
const label = getSubdomain(url, proxyDomains);
|
|
14
|
+
if (!label || !proxyLabelRegex.test(label) || hashedLabelRegex.test(label)) return;
|
|
15
|
+
const encodings = getQueryParam(url, `${proxyParamPrefix}enc`)?.split(",") ?? [];
|
|
16
|
+
let prefix = `${getQueryParam(url, `${proxyParamPrefix}hp`) ?? ""}${label}`;
|
|
17
17
|
if (encodings.includes("1") && prefix.startsWith("1-")) prefix = prefix.slice(2);
|
|
18
18
|
const isIdn = encodings.includes("0") && prefix.startsWith("0-");
|
|
19
19
|
if (isIdn) prefix = prefix.slice(2);
|
|
20
|
-
const host = `${isIdn ? "xn--" : ""}${prefix.replaceAll(
|
|
21
|
-
const scheme = url
|
|
22
|
-
const query = url.search.slice(1).split("&").filter((part) => part && !part
|
|
20
|
+
const host = `${isIdn ? "xn--" : ""}${prefix.replaceAll(singleDashRegex, ".").replaceAll("--", "-")}`;
|
|
21
|
+
const scheme = getQueryParam(url, `${proxyParamPrefix}sch`) === "http" ? "http" : "https";
|
|
22
|
+
const query = url.search.slice(1).split("&").filter((part) => part && !startsWithAnyOf(part, proxyParamPrefix)).join("&");
|
|
23
23
|
return `${scheme}://${host}${url.pathname}${query ? `?${query}` : ""}${url.hash}`;
|
|
24
24
|
};
|
|
25
25
|
const unwrapGoogleTranslate = (url) => {
|
|
26
26
|
const proxyTarget = unwrapWebsiteProxy(url);
|
|
27
27
|
if (proxyTarget) return proxyTarget;
|
|
28
28
|
const isTranslatePage = isAnyOf(url.hostname, googleTranslateHostRegex) && googleTranslatePaths.includes(url.pathname);
|
|
29
|
-
const isTranslateFrame = isHostOf(url, "translate.googleusercontent.com") && url.pathname
|
|
29
|
+
const isTranslateFrame = isHostOf(url, "translate.googleusercontent.com") && isAnyOf(url.pathname, "/translate_c");
|
|
30
30
|
if (!isTranslatePage && !isTranslateFrame) return;
|
|
31
31
|
const target = getParamValues(url, "u").at(0);
|
|
32
32
|
if (!target) return;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { isAnyOf } from "../node_modules/trousse/dist/matching.mjs";
|
|
1
2
|
import { isHostOf, isHttpUrl } from "../node_modules/trousse/dist/urls.mjs";
|
|
2
3
|
// src/unwraps/govdelivery.ts
|
|
3
|
-
const clickQueryRegex = /^\?type=click&enid=[^&]+&&&\d+&&&(.+)
|
|
4
|
+
const clickQueryRegex = /^\?type=click&enid=[^&]+&&&\d+&&&(.+)$/i;
|
|
4
5
|
const unwrapGovdelivery = (url) => {
|
|
5
|
-
if (!isHostOf(url, "links.govdelivery.com") || url.pathname
|
|
6
|
+
if (!isHostOf(url, "links.govdelivery.com") || !isAnyOf(url.pathname, "/track")) return;
|
|
6
7
|
const match = clickQueryRegex.exec(url.search);
|
|
7
8
|
if (!match?.[1]) return;
|
|
8
9
|
const target = `${match[1]}${url.hash}`;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { isHttpUrl } from "../node_modules/trousse/dist/urls.mjs";
|
|
1
|
+
import { hasQueryParam, isHttpUrl } from "../node_modules/trousse/dist/urls.mjs";
|
|
2
|
+
import { isAnyOf } from "../node_modules/trousse/dist/matching.mjs";
|
|
2
3
|
import { getParamTarget } from "../utils.mjs";
|
|
3
4
|
// src/unwraps/hasoffers.ts
|
|
4
5
|
const unwrapHasoffers = (url) => {
|
|
5
|
-
if (url.pathname
|
|
6
|
+
if (!isAnyOf(url.pathname, "/aff_c") || !hasQueryParam(url, "offer_id")) return;
|
|
6
7
|
const target = getParamTarget(url, "url");
|
|
7
8
|
if (!target || !isHttpUrl(target)) return;
|
|
8
9
|
return target;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { decodePercent, isHostOf } from "../node_modules/trousse/dist/urls.mjs";
|
|
2
|
+
import { isAnyOf } from "../node_modules/trousse/dist/matching.mjs";
|
|
3
|
+
import { getParamTarget } from "../utils.mjs";
|
|
4
|
+
// src/unwraps/hatenaBookmark.ts
|
|
5
|
+
const formPathRegex = /^\/(?:entry|add|entry\/panel)\/?$/i;
|
|
6
|
+
const schemePathRegex = /^\/entry\/(?<target>https?(?::|%3a).+)$/i;
|
|
7
|
+
const hostPathRegex = /^\/entry\/(?<secure>s\/)?(?<target>[^/.]+(?:\.[^/.]+)+(?:\/.*)?)$/i;
|
|
8
|
+
const encodedSchemeRegex = /^https?%3a/i;
|
|
9
|
+
const hosts = ["b.hatena.ne.jp"];
|
|
10
|
+
const unwrapHatenaBookmark = (url) => {
|
|
11
|
+
if (!isHostOf(url, hosts)) return;
|
|
12
|
+
if (isAnyOf(url.pathname, formPathRegex)) return getParamTarget(url, "url");
|
|
13
|
+
let target = url.pathname.match(schemePathRegex)?.groups?.target;
|
|
14
|
+
if (target && encodedSchemeRegex.test(target)) target = decodePercent(target);
|
|
15
|
+
if (!target) {
|
|
16
|
+
const match = url.pathname.match(hostPathRegex);
|
|
17
|
+
if (!match?.groups) return;
|
|
18
|
+
target = `${match.groups.secure ? "https" : "http"}://${match.groups.target}`;
|
|
19
|
+
}
|
|
20
|
+
return `${`${target}${url.search}`.replace("%23", "#")}${url.hash}`;
|
|
21
|
+
};
|
|
22
|
+
export { unwrapHatenaBookmark };
|
package/dist/unwraps/horde.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isHttpUrl } from "../node_modules/trousse/dist/urls.mjs";
|
|
2
2
|
import { getParamTarget } from "../utils.mjs";
|
|
3
3
|
// src/unwraps/horde.ts
|
|
4
|
-
const pathRegex = /^(?:\/[a-z0-9]+)?\/(?:services|util)\/go\.php
|
|
4
|
+
const pathRegex = /^(?:\/[a-z0-9]+)?\/(?:services|util)\/go\.php$/i;
|
|
5
5
|
const unwrapHorde = (url) => {
|
|
6
6
|
if (!pathRegex.test(url.pathname)) return;
|
|
7
7
|
const target = getParamTarget(url, "url");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createParamExtractor } from "../utils.mjs";
|
|
2
2
|
// src/unwraps/hubspotSidekick.ts
|
|
3
|
-
const clickPathRegex = /^\/(?:e1t|s[12]t)\/c\/5\/[^/]
|
|
3
|
+
const clickPathRegex = /^\/(?:e1t|s[12]t)\/c\/5\/[^/]+$/i;
|
|
4
4
|
const extractTarget = createParamExtractor({
|
|
5
5
|
hosts: /^t\.(?:sidekickopen\d+|senalquatro|signaledue|signalecinque|signaletre|signauxdeux|signauxdix|signauxquatre|signauxsept|signauxtrois)\.com$/,
|
|
6
6
|
params: ["t"]
|
package/dist/unwraps/impact.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { decodePercent, isHttpUrl } from "../node_modules/trousse/dist/urls.mjs";
|
|
2
2
|
import { getParamValues } from "../utils.mjs";
|
|
3
3
|
// src/unwraps/impact.ts
|
|
4
|
-
const pathRegex = /^\/c\/\d+\/\d+\/\d
|
|
4
|
+
const pathRegex = /^\/c\/\d+\/\d+\/\d+$/i;
|
|
5
5
|
const sjvHostRegex = /\.sjv\.io$/;
|
|
6
6
|
const sjvPathRegex = /^\/[A-Za-z0-9]{5,6}$/;
|
|
7
7
|
const pxfHostRegex = /\.pxf\.io$/;
|
|
8
|
-
const pxfPathRegex = /^\/(?:c\/\d+\/\d+.*|[A-Za-z0-9]+)
|
|
8
|
+
const pxfPathRegex = /^\/(?:c\/\d+\/\d+.*|[A-Za-z0-9]+)?$/i;
|
|
9
9
|
const encodedSchemeRegex = /^https?%3A/i;
|
|
10
10
|
const unwrapImpact = (url) => {
|
|
11
11
|
const isSjvPath = sjvHostRegex.test(url.hostname) && sjvPathRegex.test(url.pathname);
|
package/dist/unwraps/indexHu.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { decodePercent, isHostOf } from "../node_modules/trousse/dist/urls.mjs";
|
|
2
|
+
import { isAnyOf } from "../node_modules/trousse/dist/matching.mjs";
|
|
2
3
|
import { createParamExtractor } from "../utils.mjs";
|
|
3
4
|
// src/unwraps/indexHu.ts
|
|
4
5
|
const sectionParamRegex = /^index_[a-z]+_cikklink$/;
|
|
@@ -13,7 +14,7 @@ const unwrapCounter = createParamExtractor({
|
|
|
13
14
|
params: ["url"]
|
|
14
15
|
});
|
|
15
16
|
const unwrapSectionCounter = (url) => {
|
|
16
|
-
if (!isHostOf(url, ["dex.hu", "index.hu"]) || url.pathname
|
|
17
|
+
if (!isHostOf(url, ["dex.hu", "index.hu"]) || !isAnyOf(url.pathname, "/x")) return;
|
|
17
18
|
for (const [key, value] of url.searchParams) {
|
|
18
19
|
if (!sectionParamRegex.test(key) || !value) continue;
|
|
19
20
|
if (!encodedSchemeRegex.test(value)) return value;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { decodePercent, isHostOf, isHttpUrl } from "../node_modules/trousse/dist/urls.mjs";
|
|
2
|
+
import { createParamExtractor, decodeEncodedScheme } from "../utils.mjs";
|
|
3
|
+
// src/unwraps/inoreader.ts
|
|
4
|
+
const hosts = [
|
|
5
|
+
"inoreader.com",
|
|
6
|
+
"www.inoreader.com",
|
|
7
|
+
"jp.inoreader.com"
|
|
8
|
+
];
|
|
9
|
+
const feedPathRegex = /^\/feed\/(?<target>.+)$/i;
|
|
10
|
+
const extractAddFeed = createParamExtractor({
|
|
11
|
+
hosts,
|
|
12
|
+
path: "/",
|
|
13
|
+
params: ["add_feed"]
|
|
14
|
+
});
|
|
15
|
+
const unwrapInoreader = (url) => {
|
|
16
|
+
if (!isHostOf(url, hosts)) return;
|
|
17
|
+
const match = url.pathname.match(feedPathRegex);
|
|
18
|
+
if (!match?.groups) return extractAddFeed(url);
|
|
19
|
+
const target = decodeEncodedScheme(decodePercent(match.groups.target));
|
|
20
|
+
if (isHttpUrl(target)) return target;
|
|
21
|
+
};
|
|
22
|
+
export { unwrapInoreader };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { isAnyOf } from "../node_modules/trousse/dist/matching.mjs";
|
|
2
|
+
import { isHostOf } from "../node_modules/trousse/dist/urls.mjs";
|
|
3
|
+
import { getParamTarget } from "../utils.mjs";
|
|
4
|
+
// src/unwraps/instapaperSave.ts
|
|
5
|
+
const hosts = ["www.instapaper.com", "instapaper.com"];
|
|
6
|
+
const paths = ["/hello2", "/edit"];
|
|
7
|
+
const unwrapInstapaperSave = (url) => {
|
|
8
|
+
if (!isHostOf(url, hosts) || !isAnyOf(url.pathname, paths)) return;
|
|
9
|
+
return getParamTarget(url, "url");
|
|
10
|
+
};
|
|
11
|
+
export { unwrapInstapaperSave };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { decodePercent, isHttpUrl } from "../node_modules/trousse/dist/urls.mjs";
|
|
2
2
|
import { getParamValues } from "../utils.mjs";
|
|
3
3
|
// src/unwraps/invisionNoExternalLinks.ts
|
|
4
|
-
const pathRegex = /^(?:\/[^/]+)?\/redirect
|
|
4
|
+
const pathRegex = /^(?:\/[^/]+)?\/redirect\/$/i;
|
|
5
5
|
const encodedSchemeRegex = /^https?%3A/i;
|
|
6
6
|
const unwrapInvisionNoExternalLinks = (url) => {
|
|
7
7
|
if (!pathRegex.test(url.pathname)) return;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createParamExtractor } from "../utils.mjs";
|
|
2
2
|
// src/unwraps/involveAsia.ts
|
|
3
|
-
const deepLinkPathRegex = /^\/deep_link\/\d+(?:\/\d+)
|
|
3
|
+
const deepLinkPathRegex = /^\/deep_link\/\d+(?:\/\d+)?$/i;
|
|
4
4
|
const extractDeepLink = createParamExtractor({
|
|
5
5
|
hosts: "go.isclix.com",
|
|
6
6
|
params: ["url"]
|
package/dist/unwraps/jive.mjs
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { isAnyOf } from "../node_modules/trousse/dist/matching.mjs";
|
|
1
2
|
import { isHttpUrl } from "../node_modules/trousse/dist/urls.mjs";
|
|
2
3
|
import { getParamTarget } from "../utils.mjs";
|
|
3
4
|
// src/unwraps/jive.ts
|
|
4
5
|
const unwrapJive = (url) => {
|
|
5
|
-
if (url.pathname
|
|
6
|
+
if (!isAnyOf(url.pathname, "/external-link.jspa")) return;
|
|
6
7
|
const target = getParamTarget(url, "url");
|
|
7
8
|
if (!target || !isHttpUrl(target)) return;
|
|
8
9
|
return target;
|
package/dist/unwraps/klook.mjs
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { isAnyOf } from "../node_modules/trousse/dist/matching.mjs";
|
|
1
2
|
import { isHostOf, isHttpUrl } from "../node_modules/trousse/dist/urls.mjs";
|
|
2
3
|
import { getParamTarget } from "../utils.mjs";
|
|
3
4
|
// src/unwraps/klook.ts
|
|
4
5
|
const unwrapKlook = (url) => {
|
|
5
|
-
if (!isHostOf(url, "affiliate.klook.com") || url.pathname
|
|
6
|
+
if (!isHostOf(url, "affiliate.klook.com") || !isAnyOf(url.pathname, "/redirect")) return;
|
|
6
7
|
const target = getParamTarget(url, "k_site", -1);
|
|
7
8
|
if (target && isHttpUrl(target)) return target;
|
|
8
9
|
};
|
package/dist/unwraps/lazada.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isHostOf } from "../node_modules/trousse/dist/urls.mjs";
|
|
2
2
|
import { getPathTarget } from "../pathTarget.mjs";
|
|
3
3
|
// src/unwraps/letscast.ts
|
|
4
|
-
const trackPrefixRegex = /^\/track
|
|
4
|
+
const trackPrefixRegex = /^\/track\//i;
|
|
5
5
|
const unwrapLetscast = (url) => {
|
|
6
6
|
if (!isHostOf(url, "letscast.fm")) return;
|
|
7
7
|
return getPathTarget(url, trackPrefixRegex);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { isAnyOf } from "../node_modules/trousse/dist/matching.mjs";
|
|
2
|
+
import { isHostOf } from "../node_modules/trousse/dist/urls.mjs";
|
|
3
|
+
import { getParamTarget } from "../utils.mjs";
|
|
4
|
+
// src/unwraps/lineShare.ts
|
|
5
|
+
const sharePaths = [
|
|
6
|
+
{
|
|
7
|
+
hosts: ["social-plugins.line.me"],
|
|
8
|
+
path: /^\/(?:lineit\/share(?:\/ui)?|social-plugin\/share)$/i
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
hosts: ["lineit.line.me"],
|
|
12
|
+
path: /^\/share(?:\/ui)?$/i
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
hosts: ["timeline.line.me"],
|
|
16
|
+
path: /^\/(?:lineit|social-plugin)\/share$/i
|
|
17
|
+
}
|
|
18
|
+
];
|
|
19
|
+
const unwrapLineShare = (url) => {
|
|
20
|
+
if (!sharePaths.some(({ hosts, path }) => {
|
|
21
|
+
return isHostOf(url, hosts) && isAnyOf(url.pathname, path);
|
|
22
|
+
})) return;
|
|
23
|
+
return getParamTarget(url, "url");
|
|
24
|
+
};
|
|
25
|
+
export { unwrapLineShare };
|
package/dist/unwraps/linkA.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createParamExtractor } from "../utils.mjs";
|
|
2
2
|
// src/unwraps/linkA.ts
|
|
3
|
-
const productLinkPathRegex = /^\/click_product_link\/[0-9a-f]+\/[0-9a-f]
|
|
3
|
+
const productLinkPathRegex = /^\/click_product_link\/[0-9a-f]+\/[0-9a-f]+\/?$/i;
|
|
4
4
|
const extractGateTarget = createParamExtractor({
|
|
5
5
|
hosts: "link-a.net",
|
|
6
6
|
path: "/gate.php",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isHostOf } from "../node_modules/trousse/dist/urls.mjs";
|
|
2
2
|
import { getParamTarget } from "../utils.mjs";
|
|
3
3
|
// src/unwraps/linkedin.ts
|
|
4
|
-
const shimPathRegex = /^\/(safety\/go|redir\/redirect)\/?$|^\/(redirect|nhome\/nus-redirect|nus-trk|e\/v2)$|^\/company\/[^/]+\/redirect
|
|
4
|
+
const shimPathRegex = /^\/(safety\/go|redir\/redirect)\/?$|^\/(redirect|nhome\/nus-redirect|nus-trk|e\/v2)$|^\/company\/[^/]+\/redirect$/i;
|
|
5
5
|
const unwrapLinkedin = (url) => {
|
|
6
6
|
if (!isHostOf(url, "www.linkedin.com") || !shimPathRegex.test(url.pathname)) return;
|
|
7
7
|
const target = getParamTarget(url, "url");
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { isAnyOf } from "../node_modules/trousse/dist/matching.mjs";
|
|
2
|
+
import { isHostOf } from "../node_modules/trousse/dist/urls.mjs";
|
|
3
|
+
import { getParamTarget } from "../utils.mjs";
|
|
4
|
+
// src/unwraps/linkedinShare.ts
|
|
5
|
+
const hosts = [
|
|
6
|
+
"www.linkedin.com",
|
|
7
|
+
"linkedin.com",
|
|
8
|
+
/^[a-z]{2}\.linkedin\.com$/
|
|
9
|
+
];
|
|
10
|
+
const pathRegex = /^\/(?:shareArticle|sharing\/share-offsite|cws\/share|share)\/?$/i;
|
|
11
|
+
const unwrapLinkedinShare = (url) => {
|
|
12
|
+
if (!isHostOf(url, hosts) || !isAnyOf(url.pathname, pathRegex)) return;
|
|
13
|
+
return getParamTarget(url, "url");
|
|
14
|
+
};
|
|
15
|
+
export { unwrapLinkedinShare };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { decodePercent, isHostOf, isHttpUrl } from "../node_modules/trousse/dist/urls.mjs";
|
|
2
2
|
import { getParamValues } from "../utils.mjs";
|
|
3
3
|
// src/unwraps/linksynergy.ts
|
|
4
|
-
const
|
|
4
|
+
const hosts = [
|
|
5
5
|
"click.linksynergy.com",
|
|
6
6
|
"linksynergy.jrs5.com",
|
|
7
7
|
"linksynergy.walmart.com"
|
|
@@ -13,7 +13,7 @@ const carrierParams = {
|
|
|
13
13
|
"/fs-bin/stat": "RD_PARM1"
|
|
14
14
|
};
|
|
15
15
|
const unwrapLinksynergy = (url) => {
|
|
16
|
-
if (!isHostOf(url,
|
|
16
|
+
if (!isHostOf(url, hosts)) return;
|
|
17
17
|
const param = carrierParams[url.pathname];
|
|
18
18
|
if (!param) return;
|
|
19
19
|
const target = getParamValues(url, param).at(0);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { isHttpUrl } from "../node_modules/trousse/dist/urls.mjs";
|
|
1
|
+
import { hasQueryParam, isHttpUrl } from "../node_modules/trousse/dist/urls.mjs";
|
|
2
|
+
import { isAnyOf } from "../node_modules/trousse/dist/matching.mjs";
|
|
2
3
|
import { getParamTarget } from "../utils.mjs";
|
|
3
4
|
// src/unwraps/linktrust.ts
|
|
4
5
|
const params = [
|
|
@@ -7,8 +8,7 @@ const params = [
|
|
|
7
8
|
"nonencodedurl"
|
|
8
9
|
];
|
|
9
10
|
const unwrapLinktrust = (url) => {
|
|
10
|
-
|
|
11
|
-
if (pathname !== "/click.track" || !searchParams.has("CID") || !searchParams.has("AFID")) return;
|
|
11
|
+
if (!isAnyOf(url.pathname, "/click.track") || !hasQueryParam(url, "CID") || !hasQueryParam(url, "AFID")) return;
|
|
12
12
|
for (const param of params) {
|
|
13
13
|
const target = getParamTarget(url, param, -1);
|
|
14
14
|
if (target && isHttpUrl(target)) return target;
|