@breadcrum/bookmarklet
Advanced tools
Comparing version 1.0.8 to 1.0.9
// <define:DATA> | ||
var define_DATA_default = { bookmarklet: `javascript:((()=>{var l={ver:"1.0.8"};var p=t=>t?.innerText??t?.textContent??"";var v=[".instapaper_title","article h1",".entry-content h1",".markdown-body h1",".entry-title",".post-title",".pageTitle",".post_title",".headline h1",".headline",".story h1",".entry-header h1",".news_title","#page-post h1",".postheader h1",".postheader h2",".type-post h1"],m=t=>t.replace(/\\r?\\n/g,"").replace(/\\s+/g," ").trim().substring(0,255),y="GitHub - ",P=t=>{for(let o of v){let e=p(t.querySelector(o))?.trim();if(e&&e.length>0)return e}};function w({document:t}){let o=t.location,e=p(t.querySelector("title"))?.replace(/\\r?\\n/g,"");if(o?.hostname?.endsWith("twitter.com")&&o?.pathname?.includes("/status/")){let c=e.split(': "')[0];return m(c)}if(o?.hostname?.endsWith("github.com")){e.startsWith(y)&&(e=e.replace(y,""));let c=e.split(":");return c.length>1?m(c[0]):m(e)}let r=t.querySelector("meta[property='og:title']")?.content;if(r&&r.length>5&&r.length<100)return m(r);let n=t.querySelector("meta[name='twitter:title']")?.content;if(n&&n.length>5&&n.length<100)return m(n);let s=P(t);return s&&s.length>5&&s.length<100?m(s):m(e)}var g=t=>t?.getAttribute("content")||t?.getAttribute("value");var h=t=>t?.replace(/\\s+/g," ").trim()||"";function T({document:t,title:o}){let e=t.location,r=String(t?.getSelection());if(r&&r.length>1)return h(r);if(e?.hostname?.endsWith("twitter.com")&&e?.pathname?.includes("/status/"))return(p(t.querySelector("title"))?.replace(/\\r?\\n/g,"")).split(': "')[1].split('" / Twitter')[0];let n=f(t);return h(b(n?{summary:n,title:o}:{summary:W(t),title:o}))}function b({title:t,summary:o}){return o?.replace(t,"")||o}function f(t){let o=g(t.querySelector("meta[name='description'],meta[description]"));if(o)return h(o);let e=g(t.querySelector("meta[property='og:description']"));if(e)return h(e);let r=g(t.querySelector("meta[name='twitter:description']"));return r?h(r):""}function W(t){return p(t.querySelector("article p"))?.replace(/\\r?\\n/g,"")?.replace(/\\s+/g," ")?.trim()}function S({document:t,title:o,summary:e}){let r=t.location,n=new Set,s=[u(o),u(e)],c=f(t);c&&s.push(u(c));let d=g(t.querySelector('meta[name="keywords"],meta[itemprop="keywords"]'));d&&s.push(u(d));let k=s.join(" ");for(let[i,a]of Object.entries($))k.includes(i)&&n.add(a);if(r?.hostname?.endsWith("github.com")){if(t.querySelector(".h-card")){n.add("person");let a=t.querySelector(".p-nickname").innerText;a&&n.add(\`gh:\${a}\`)}let i=r?.pathname?.split("/");i.length>=3&&(n.add("repo"),n.add(\`gh:\${i[1]}\`))}if(r?.hostname?.endsWith("twitter.com")){let i=r?.pathname?.split("/");if(r?.pathname?.includes("/status/")&&n.add("tweet"),i.length>=2){let a=i[1];n.add(\`twtr:\${a}\`)}}for(let[i,a]of Object.entries(C))(i instanceof RegExp?i:new RegExp("\\\\b"+i+"\\\\b","i")).test(t?.location?.href)&&n.add(a);return Array.from(n)}function u(t){return t.toLowerCase()}var $={javascript:"javascript",js:"javascript",clojure:"clojure",clj:"clojure",clojurescript:"clojurescript",cljs:"clojurescript",python:"python",ios:"ios",video:"video",books:"book",book:"book"},C={"medium.com/([^/]+)$":"blog","medium.com/([^/]+)/.*":"blog-posting","stackoverflow.com/questions/\\\\d+/[^/]+/\\\\d+":"answer","stackoverflow.com/questions/\\\\d+/[^/]+/?$":"question","nytimes.com":"article","washingtonpost.com":"article","youtube.com/watch":"video","vimeo.com/\\\\d+":"video","imdb.com/title":"movie","imdb.com/name":"person","news.ycombinator.com/item":"comment","reddit.com":"comment","blog.":"blog","schema.org/\\\\S+":"type","goodreads.com/book/show/":"book"};function x(t){let o=w({document:t}),e=T({document:t,title:o}),r=S({document:t,title:o,summary:e});return{title:o,summary:e,tags:r}}var{ver:D}=l,M=680,O=710,R=location.href,{title:A,summary:_,tags:E}=x(document),j=new URLSearchParams({url:R,title:A,summary:_,ver:D,jump:"close"});for(let t of E)j.append("tags",t);window.open(\`TRANSPORT://HOST/bookmarks/add?\${j.toString()}\`,"WINDOW_TITLE",\`toolbar=no,width=\${O},height=\${M}\`);})())` }; | ||
var define_DATA_default = { bookmarklet: `javascript:((()=>{var l={ver:"1.0.9"};var p=t=>t?.innerText??t?.textContent??"";var v=[".instapaper_title","article h1",".entry-content h1",".markdown-body h1",".entry-title",".post-title",".pageTitle",".post_title",".headline h1",".headline",".story h1",".entry-header h1",".news_title","#page-post h1",".postheader h1",".postheader h2",".type-post h1"],m=t=>t.replace(/\\r?\\n/g,"").replace(/\\s+/g," ").trim().substring(0,255),y="GitHub - ",P=t=>{for(let o of v){let e=p(t.querySelector(o))?.trim();if(e&&e.length>0)return e}};function w({document:t}){let o=t.location,e=p(t.querySelector("title"))?.replace(/\\r?\\n/g,"");if(o?.hostname?.endsWith("twitter.com")&&o?.pathname?.includes("/status/")){let c=e.split(': "')[0];return m(c)}if(o?.hostname?.endsWith("github.com")){e.startsWith(y)&&(e=e.replace(y,""));let c=e.split(":");return c.length>1?m(c[0]):m(e)}let r=t.querySelector("meta[property='og:title']")?.content;if(r&&r.length>5&&r.length<100)return m(r);let n=t.querySelector("meta[name='twitter:title']")?.content;if(n&&n.length>5&&n.length<100)return m(n);let s=P(t);return s&&s.length>5&&s.length<100?m(s):m(e)}var g=t=>t?.getAttribute("content")||t?.getAttribute("value");var h=t=>t?.replace(/\\s+/g," ").trim()||"";function T({document:t,title:o}){let e=t.location,r=String(t?.getSelection());if(r&&r.length>1)return h(r);if(e?.hostname?.endsWith("twitter.com")&&e?.pathname?.includes("/status/"))return(p(t.querySelector("title"))?.replace(/\\r?\\n/g,"")).split(': "')[1].split('" / Twitter')[0];let n=f(t);return h(b(n?{summary:n,title:o}:{summary:W(t),title:o}))}function b({title:t,summary:o}){return o?.replace(t,"")||o}function f(t){let o=g(t.querySelector("meta[name='description'],meta[description]"));if(o)return h(o);let e=g(t.querySelector("meta[property='og:description']"));if(e)return h(e);let r=g(t.querySelector("meta[name='twitter:description']"));return r?h(r):""}function W(t){return p(t.querySelector("article p"))?.replace(/\\r?\\n/g,"")?.replace(/\\s+/g," ")?.trim()}function S({document:t,title:o,summary:e}){let r=t.location,n=new Set,s=[u(o),u(e)],c=f(t);c&&s.push(u(c));let d=g(t.querySelector('meta[name="keywords"],meta[itemprop="keywords"]'));d&&s.push(u(d));let k=s.join(" ");for(let[i,a]of Object.entries($))k.includes(i)&&n.add(a);if(r?.hostname?.endsWith("github.com")){if(t.querySelector(".h-card")){n.add("person");let a=t.querySelector(".p-nickname").innerText;a&&n.add(\`gh:\${a}\`)}let i=r?.pathname?.split("/");i.length>=3&&(n.add("repo"),n.add(\`gh:\${i[1]}\`))}if(r?.hostname?.endsWith("twitter.com")){let i=r?.pathname?.split("/");if(r?.pathname?.includes("/status/")&&n.add("tweet"),i.length>=2){let a=i[1];n.add(\`twtr:\${a}\`)}}for(let[i,a]of Object.entries(C))(i instanceof RegExp?i:new RegExp("\\\\b"+i+"\\\\b","i")).test(t?.location?.href)&&n.add(a);return Array.from(n)}function u(t){return t.toLowerCase()}var $={javascript:"javascript",js:"javascript",clojure:"clojure",clj:"clojure",clojurescript:"clojurescript",cljs:"clojurescript",python:"python",ios:"ios",video:"video",books:"book",book:"book"},C={"medium.com/([^/]+)$":"blog","medium.com/([^/]+)/.*":"blog-posting","stackoverflow.com/questions/\\\\d+/[^/]+/\\\\d+":"answer","stackoverflow.com/questions/\\\\d+/[^/]+/?$":"question","nytimes.com":"article","washingtonpost.com":"article","youtube.com/watch":"video","vimeo.com/\\\\d+":"video","imdb.com/title":"movie","imdb.com/name":"person","news.ycombinator.com/item":"comment","reddit.com":"comment","blog.":"blog","schema.org/\\\\S+":"type","goodreads.com/book/show/":"book"};function x(t){let o=w({document:t}),e=T({document:t,title:o}),r=S({document:t,title:o,summary:e});return{title:o,summary:e,tags:r}}var{ver:D}=l,M=800,O=710,R=location.href,{title:A,summary:_,tags:E}=x(document),j=new URLSearchParams({url:R,title:A,summary:_,ver:D,jump:"close"});for(let t of E)j.append("tags",t);window.open(\`TRANSPORT://HOST/bookmarks/add?\${j.toString()}\`,"WINDOW_TITLE",\`toolbar=no,width=\${O},height=\${M}\`);})())` }; | ||
@@ -4,0 +4,0 @@ // scripts/wrapper.js |
// <define:PKG> | ||
var define_PKG_default = { ver: "1.0.8" }; | ||
var define_PKG_default = { ver: "1.0.9" }; | ||
@@ -4,0 +4,0 @@ // scripts/version.js |
@@ -9,3 +9,3 @@ { | ||
], | ||
"version": "1.0.8", | ||
"version": "1.0.9", | ||
"author": "Bret Comnes <bcomnes@gmail.com> (https://bret.io)", | ||
@@ -17,6 +17,5 @@ "bugs": { | ||
"auto-changelog": "^2.0.0", | ||
"c8": "^7.10.0", | ||
"dependency-cruiser": "^13.0.0", | ||
"dependency-cruiser": "^14.0.0", | ||
"desm": "^1.3.0", | ||
"esbuild": "^0.17.10", | ||
"esbuild": "^0.19.0", | ||
"gh-release": "^7.0.0", | ||
@@ -26,3 +25,3 @@ "npm-run-all2": "^6.0.0", | ||
"standard": "^17.0.0", | ||
"tap": "^16.3.2" | ||
"tap": "^18.4.0" | ||
}, | ||
@@ -57,3 +56,3 @@ "engines": { | ||
"test:standard": "standard --verbose | snazzy", | ||
"test:tap": "METRICS=0 c8 tap --no-coverage --color", | ||
"test:tap": "tap", | ||
"version": "run-s prepare version:*", | ||
@@ -74,6 +73,9 @@ "version:changelog": "auto-changelog -p --template keepachangelog auto-changelog --breaking-pattern 'BREAKING CHANGE:'", | ||
}, | ||
"c8": { | ||
"reporter": [ | ||
"lcov", | ||
"text" | ||
"tap": { | ||
"serial": [], | ||
"typecheck": false, | ||
"allow-incomplete-coverage": true, | ||
"coverage-report": [ | ||
"text", | ||
"lcovonly" | ||
] | ||
@@ -80,0 +82,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10054
9