Format - k08045kk/CopyTabTitleUrl GitHub Wiki
You can freely create copy strings using the format ${value}
.
- Idea⨠(Unimplemented): Allows you to choose the prefix and suffix.
- Example:
${value}
,%value%
,{{value}}
- Example:
format | description | version |
---|---|---|
${title} |
Page title | v0.0.7 |
${url} |
Page URL | v0.0.7 |
${enter} |
Newline characters (Windows:\r\n , Mac/Linux:\n ) |
v0.0.9 |
${$} |
$ | v1.5.4 |
β» Non-standard features will not work unless "Extended Mode" is enabled.
format | description | version |
---|---|---|
${title} |
Page title | v0.0.7 |
${url} |
Page URL | v0.0.7 |
${markdown} |
v2.1.0 - v3.1.0 π§ͺ | |
${frameUrl} |
Frame URL or page URL (β»1) | v3.1.0 π§ͺ |
${text} |
Selection text or page title (β»2) | v1.5.2 π§ͺ |
${selectionText} ${selectedText} ποΈ |
Selection text or blank text (β»2) | v2.2.1, v3.1.0 π§ͺ |
${linkText} |
Link text or page title (β»3) | v2.1.0 π§ͺ (Firefox only π¦) |
${linkUrl} , ${link}
|
Link URL or page URL (β»3) | v2.1.0 π§ͺ |
${src} |
"src" URL or page URL (β»4) | v2.1.0 π§ͺ |
${linkSelectionTitle} |
Link text or Selection text or page title (β»2,3) | v2.2.0 π§ͺ |
${selectionLinkTitle} |
Selection text or link text or page title (β»2,3) | v2.2.0 π§ͺ |
${linkSrcUrl} |
Link URL or "src" URL or page URL (β»2,3,4) | v2.2.0 π§ͺ |
${srcLinkUrl} |
"src" URL or link URL or page URL (β»2,3,4) | v2.2.0 π§ͺ |
${index} |
Serial number from 0 per window | v1.5.2 π§ͺ |
${tabId} , $(id} ποΈ |
Tab ID | v2.1.0 π§ͺ, v1.5.2 π§ͺ |
${windowId} |
Tab host window ID | v2.1.0 π§ͺ |
${favIconUrl} |
Favicon URL or blank text | v1.6.0, v3.1.0 π§ͺ |
${strippedUrl} |
URL without site tracking | v----- π§ͺβ¨ |
β»1: Used in the context menus.
β»2: Used in the selection context menus.
γγYou can use it outside of the context menu by enabling [Use content script for active tab π§ͺπ§ͺ].
β»3: Used in the link context menu.
β»4: Used in the image context menu.
β»ποΈ Deprecated: ${TITLE}
, ${URL}
, ${ENTER}
, ${TEXT}
, ${selectedText}
, ${INDEX}
, ${id}
, ${ID}
format | description | version |
---|---|---|
${enter} |
Newline characters (Windows:\r\n , Mac/Linux:\n ) |
v0.0.9 |
${CR} , ${r} ποΈ |
Carriage Return (\r ) |
v1.1.1, v1.5.2 π§ͺ |
${LF} , ${n} ποΈ |
Line Feed (\n ) |
v1.1.1, v1.5.2 π§ͺ |
${TAB} , ${t} ποΈ |
Horizontal Tab (\t ) |
v0.0.9, v1.5.2 π§ͺ |
${$} |
$ | v1.5.4 |
${xXX} |
v----- π§ͺβ¨ |
β»ποΈ Deprecated: ${\r}
, ${\n}
, ${\t}
, ${r}
, ${n}
, ${t}
, ${cr}
, ${lf}
, ${tab}
β» In particular, the use of ${tab}
is discouraged. (because it may be used in Programmable Format)
format | description | version |
---|---|---|
${infoButton} |
0:left / 1:middle / 2:right | v3.4.0 (Firefox Only π¦) |
${infoEditable} |
true / false | v3.4.0 |
${infoFrameId} |
v3.4.0 | |
${infoFrameUrl} |
v3.4.0 | |
${infoLinkText} |
v3.4.0 (Firefox Only π¦) | |
${infoLinkUrl} |
v3.4.0 | |
${infoMediaType} |
v3.4.0 | |
${infoModifiers} |
[], ["Ctrl"], ["Shift","Ctrl"], ... | v3.4.0 (Firefox Only π¦) |
${infoPageUrl} |
v3.4.0 | |
${infoSelectionText} |
v3.4.0 | |
${infoSrcUrl} |
v3.4.0 | |
${infoTargetElementId} |
v3.4.0 (Firefox Only π¦) |
β» see https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/menus/OnClickData
β» You can also browse from multiple tabs.
format | description | version |
---|---|---|
${yyyy} , ${yy} , ${y} ${YYYY} , ${YY} , ${Y}
|
year | v1.5.4, v3.1.0 π§ͺ |
${MM} , ${M}
|
month | v1.5.4 π§ͺ |
${dd} , ${d} ${DD} , ${D}
|
day of month | v1.5.4, v3.1.0 π§ͺ |
${HH} , ${H}
|
hours (24 hours) | v1.5.4 π§ͺ |
${hh} , ${h}
|
hours (12 hours) | v1.5.4 π§ͺ |
${mm} , ${m}
|
minutes | v1.5.4 π§ͺ |
${ss} , ${s}
|
seconds | v1.5.4 π§ͺ |
${SSS} , ${S}
|
milliseconds | v1.5.4 π§ͺ |
${AA} , ${aa}
|
AM/PM, am/pm | v2.2.2 π§ͺ |
${AAAA} , ${aaaa}
|
A.M./P.M., a.m./p.m. | v2.2.2 π§ͺ |
${W} |
Sunday/Monday/Tuesday/Wednesday/Thursday/Friday/Saturday | v2.2.2 π§ͺ |
${WWW} |
Sun/Mon/Tue/Wed/Thu/Fri/Sat | v2.2.2 π§ͺ |
${day} , ${dayOfWeek}
|
0=Sun/1=Mon/2=Tue/3=Wed/4=Thu/5=Fri/6=Sat | v3.1.0 π§ͺ |
${time} |
Elapsed time since epoch (milliseconds) | v3.1.0 π§ͺ |
${timezoneOffset} |
minute offset from UTC | v3.1.0 π§ͺ |
β» ${yyyy}-${MM}-${dd}T${HH}:${mm}:${ss}.${SSS}
γ2020-04-03T00:48:23.456
format | description | version |
---|---|---|
${href} |
URL Similar: ${protocol:}${username:password@}${host}${pathname}${search}${hash}
|
v1.5.6 π§ͺ |
${origin} |
URL origin β»1 Similar: ${protocol:}${host}
|
v1.5.6 π§ͺ |
${protocol} |
protocol: β»2 |
v1.5.6 π§ͺ |
${protocol:} |
protocol:(//) | v3.5.20 π§ͺ |
${username} |
(username) | v3.1.0 π§ͺ |
${password} |
(password) | v3.1.0 π§ͺ |
${username@} |
(username@) | v3.1.0 π§ͺ |
${username:password@} |
(username(:password)@) | v3.1.0 π§ͺ |
${host} |
hostname(:port) | v1.5.6 π§ͺ |
${hostname} |
hostname | v1.5.6 π§ͺ |
${port} |
(port) | v1.5.6 π§ͺ |
${:port} |
(:port) | v1.5.6 π§ͺ |
${pathname} |
/pathname | v1.5.6 π§ͺ |
${search} |
(?param) | v1.5.6 π§ͺ |
${hash} |
(#hash) | v1.5.6 π§ͺ |
β» If (data)
does not exist, it is treated as an empty string.
β» ${protocol}//${host}${pathname}${search}${hash}
γhttps://example.com/path/file?key=value&query#hash
β» window.URL - Web API | MDN
β»1: May return null
for protocols other than: http, https, ftp, ws, wss
β»2: It is commonly used as "${protocol}//
", but be aware that this will cause issues with the following URL:
γγabout:about
γγview-source:https://[email protected]/k08045kk
Plain:
${title}${enter}${url}
${title}
${url}
Markdown:
[${title}](${url})
HTML:
<a href="${url}">${title}</a>
<a href="${url}">${title}</a><br/>
<p><a href="${url}">${title}</a></p>
<a href="${url}" target="_blank" rel="noopener">${title}</a>
LaTeX:
\url{${url}}
\href{${url}}{${title}}
Redmine:
"${title}":${url}
reStructuredText:
`${title} <${url}>`_
β» No automatic escaping to format strings is performed.
- [Enable programmable format π§ͺπ§ͺ] [v3.1.0]
- Alias, function name: programmable format, programmable
- The format can be extended using functions and assignments.
- Please do not write complicated processing using this function.
- This feature exists to connect multiple features.
- browser information, regular expressions, user scripts, external programs.
- I believe this functionality does not apply to remote code.
- If it turns out to be remote code or something similar, I will protect the extension by removing this feature.
- The option appears when you enable [Use Extended Edit Mode π§ͺ].
- Please check the source code for details on this feature.
/background/compiler.js
format | description | version |
---|---|---|
${integer} β»1Example: ${123} , ${-1}
|
Number Only integer values are allowed. |
v3.1.0 π§ͺπ§ͺ |
${"string"} , ${'string'} β»2Example: ${"ζεε"}
|
String "}" cannot be used. There is also no escape processing. |
v3.1.0 π§ͺπ§ͺ |
${undefined} |
undefined (Not the string "undefined ") | v3.1.0 v3.2.0 π§ͺπ§ͺ |
${null} |
null (Not the string "null") | v3.1.0 v3.2.0 π§ͺπ§ͺ |
${true} |
true (Boolean) | v3.1.0 π§ͺπ§ͺ |
${false} |
false (Boolean) | v3.1.0 π§ͺπ§ͺ |
${NaN} |
NaN (Number.NaN) | v3.1.0 π§ͺπ§ͺ |
${Infinity} |
Infinity (Number.POSITIVE_INFINITY) | v3.1.0 π§ͺπ§ͺ |
${dollar} |
"$" | v3.5.13 π§ͺπ§ͺ |
${lbrace} |
"{" | v3.5.13 π§ͺπ§ͺ |
${rbrace} |
"}" | v3.5.13 π§ͺπ§ͺ |
${language} |
navigator.language | v3.5.16 π§ͺπ§ͺ |
${tabs.length} |
Total number of tabs to copy | v----- π§ͺπ§ͺβ¨ |
${tabsLength} |
Total number of tabs to copy | v3.1.0 π§ͺπ§ͺ |
${tabsIndex} |
Sequential number of tab to copy (from 0) | v3.2.0 π§ͺπ§ͺ |
${tab.prop} |
chrome.tabs.Tab β»3 | v----- π§ͺπ§ͺβ¨ |
${tabProp} |
chrome.tabs.Tab β»3 | v3.1.0 π§ͺπ§ͺ |
β» Types are automatically converted.
γExample: ${Math.not(false)}
, ${Math.not(0)}
, ${Math.not(-0)}
,
γγγγγγ${Math.not(null)}
, ${Math.not(NaN)}
, ${Math.not('')}
// output: true
γExample: ${Math.not('string')}
, ${Math.not('false')}
, ${Math.not(-1)}
// output: false
β»1: Numeric values should be defined in a form that matches the following regular expression: /^[+\-]?\d+$/
β»2: String values should be defined in a form that matches the following regular expression: /^("[^"}]*"|'[^'}]*')$/
β»3: see https://developer.mozilla.org/docs/Mozilla/Add-ons/WebExtensions/API/tabs/Tab
format | description | version |
---|---|---|
${System.log(...args)} |
WebExtension background DevTools Console β»1 | v3.4.2, v3.5.12 π§ͺπ§ͺ |
${System.compile(arg)} |
Treat arg as format (Function processing) | v----- π§ͺπ§ͺβ¨ |
${Math.fn()} |
calculation / control functions | v3.1.0 π§ͺπ§ͺ |
${Boolean.fn()} |
boolean functions | v----- π§ͺπ§ͺβ¨ |
${Number.fn()} |
number functions | v----- π§ͺπ§ͺβ¨ |
${String.fn()} |
string functions | v3.1.0 π§ͺπ§ͺ |
${Date.fn()} |
date functions | v3.1.0 π§ͺπ§ͺ |
${Array.fn()} |
array functions | v----- π§ͺπ§ͺβ¨ |
${gloablThis["gprop"]} ποΈExample: ${globalThis["tab.status"]}
|
Accessing properties that contain symbols | v3.1.0 π§ͺπ§ͺ |
β»1: Enable browser developer mode
Math.fn(): add / sub / mul / div / mod / and / or / not / random
Math.fn(): lt / lte / gt / gte / eq / neq / seq / nseq / cond / ncond / any
String.fn(): fromCharCode / fromCodePoint
γγsee String - JavaScript | MDN
Date.fn(): toDateString / toISOString / toString / toTimeString / toUTCString / toLocaleDateString / toLocaleString / toLocaleTimeString
γγsee Date - JavaScript | MDN
Array.fn(): at / concat / includes / indexOf / isArray / join / pop / push / reverse / shift / slice / splice / unshift / with
γγsee Array - JavaScript | MDN
format | description | version |
---|---|---|
${in} Example: ${title}
|
value | v3.1.0 π§ͺπ§ͺ |
${out=in} Example: ${x=title}
|
Assignment. No output is produced. Assignment to reserved words is not possible. β»1 |
v3.1.0 π§ͺπ§ͺ |
${in[idx]} , ${in[key]} Example: ${x='["a","b","c"]'}${x[1]} Example: ${x='[1,2,3]'}${x["length"]}
|
Accessing Array and Object. | v3.1.0 π§ͺπ§ͺ |
${in.fn} Example: ${title.length}
|
property access | v3.1.0 π§ͺπ§ͺ |
${in.fn(arg1,arg2)} Example: ${title.slice(-4)}
|
Function. |
v3.1.0, v3.5.12 π§ͺπ§ͺ |
β» Some specifications differ from standard JavaScript functions.
β»1: Reserved words (reserved words may increase in the future)
γγMath, String, true, false, null, undefined, NaN, Infinity, $, title, url
format | version |
---|---|
in.replace(pattern: RegExp, replacement: string): string | v3.1.0 π§ͺπ§ͺ |
in.replaceAll(pattern: RegExp, replacement: string): string | v3.1.0 π§ͺπ§ͺ |
in.match(regexp: RegExp, flags: string): string[],empty | v3.1.0 π§ͺπ§ͺ |
in.search(regexp: RegExp): number | v3.1.0 π§ͺπ§ͺ |
in.concat(...args: string): string | v3.1.0, v3.5.12 π§ͺπ§ͺ |
in.localeCompare(compareString: string): number | v----- π§ͺπ§ͺβ¨ |
in.matchAll(regexp: RegExp): Iterator<string[]> | v----- π§ͺπ§ͺβ¨ |
... |
in.fn: length
in.fn(): replace / replaceAll / match / search / substring / slice / padStart / padEnd / at / charAt / charCodeAt / codePointAt / repeat / startsWith / endsWith / includes / indexOf / lastIndexOf / normalize / concat / split / isWellFormed / trim / trimStart / trimEnd / toLocaleLowerCase / toLocaleUpperCase / toLowerCase / toString / toUpperCase / toWellFormed / valueOf
see String - JavaScript | MDN
β» Items that are not significantly different from JavaScript will be omitted.
β» Arguments that accept regular expressions only accept regular expressions.
β» Returns an empty string instead of null.
Markdown escaped title:
format = ${title.replaceAll(text0,'\$&')}
${text0} = [*_\\`#+\-.!{}[\]()]
Amazon.com shortened URL
format = ${url.replace(text0,"$1$2")}
${text0} = ^(https?:\/\/www\.amazon\.(?:com|co\.jp))(?:\/.*)?(\/dp\/\w+)[\/\?#]?.*$
Localize the day of week
format = ${text0[dayOfWeek]}
${text0} = ["ζ₯","ζ","η«","ζ°΄","ζ¨","ι","ε"]
Localize the AM/PM
format = ${ampm=Math.div(H,12)}${text0[ampm]}
${text0} = ["εε","εεΎ"]
Control character output
format = ${String.fromCodePoint(9)}
Branch processing for each site
format = ${text0[hostname]}
${text0} = {"www.google.com":"Google","github.com":"GitHub"}
Branch processing for each site
format = ${x=Math.eq(hostname,text0)}${Math.cond(x,"Google")}${Math.condn(x,"not Google")}
${text0} = www.google.com
- If parsing fails, leave the syntax as is.
-
${x}
->${x}
-
- If an error occurs during execution, include the error.
-
${x}
->${x}[Error: ....]
-
- The syntax must not contain whitespace.
${x.replace('abc', 'xyz')}
error ^
- Note that assignment breaks existing variables.
- Compilation of separator is performed only once, at the beginning.
- This feature comes into play when setting initial values.
- At this time, we disclaim all warranties including compatibility.
- [Use content script for active tab π§ͺπ§ͺ] [v3.1.0]
- Alias, function name: scripting, content script
- Use page content using content script.
- Selection text can be used outside of context menus.
- Works on active tab.
- Use activeTab permission.
- Does not use host permission.
- Idea⨠(Unimplemented): Option to force disable the script:
${scripting=false}
- Idea⨠(Unimplemented): Option to force enable the script:
${scripting=true}
- The option appears when you enable [Use Extended Edit Mode π§ͺ].
- Please check the source code for details on this feature.
/background/scripting.js
- [Use content script for all frames π§ͺπ§ͺ] [v3.4.4]
- Selection text works even when subframes are selected.
- If the selection spans multiple frames, the selected string of the first frame will be output.
- Currently, this feature has no effect on anything other than the selection string.
-
However, there seems to be a problem with some sites not returning responses (#66)Therefore, we set a timeout of 150ms.
- It is recommended that this setting not be easily enabled and only be enabled when necessary.
- Selection text works even when subframes are selected.
- [Inject content script after page loaded π§ͺπ§ͺ] (v3.5.6)
- β
If enabled, insert the content scripts after the page loading is complate.
- This timing is commonly referred to as
document_idle
. - In a slow-loading environment, this feels slower than expected.
- If you wait for the page to load, you may feel uncomfortable with pop-ups and other displays.
- This timing is commonly referred to as
- β¬ If disabled, the script will be inserted immediately.
- Therefore, the page may not have finished loading. It is also possible that the user script has not yet been executed.
- As a result, retrieval of some data may fail.
-
${pageTitle}
,${pageH1}
,${pageText0}
, etc...
-
- β
If enabled, insert the content scripts after the page loading is complate.
format | description | version |
---|---|---|
${scripting} |
true / false | v3.1.0 π§ͺπ§ͺ |
${pageError} |
error message | v3.4.4 π§ͺπ§ͺ |
${canonicalUrl} |
${pageCanonicalUrl} or ${ogUrl} or ${url}
|
v3.1.0 π§ͺπ§ͺ |
${ogpUrl} |
${ogUrl} or ${pageCanonicalUrl} or ${url}
|
v3.1.0 π§ͺπ§ͺ |
${ogpImage} |
${ogImage} or ${pageImageSrc}
|
v3.1.0 π§ͺπ§ͺ |
${ogpTitle} |
${ogTitle} or ${metaTitle} or ${pageTitle} or ${title}
|
v3.1.0 π§ͺπ§ͺ |
${ogpDescription} |
${ogDescription} or ${metaDescription}
|
v3.1.0 π§ͺπ§ͺ |
format | description | version |
---|---|---|
${pageTitle} |
document.title |
v3.1.0 v3.2.0 π§ͺπ§ͺ |
${pageURL} |
document.URL |
v3.2.0 π§ͺπ§ͺ |
${pageCharset} |
document.characterSet |
v3.2.0 π§ͺπ§ͺ |
${pageContentType} |
document.contentType |
v3.2.0 π§ͺπ§ͺ |
${pageCookie} |
document.cookie |
v3.2.0 π§ͺπ§ͺ |
${pageDir} |
document.dir |
v3.2.0 π§ͺπ§ͺ |
${pageDoctype} |
document.doctype |
v3.2.0 π§ͺπ§ͺ |
${pageLastModified} |
document.lastModified |
v3.2.0 π§ͺπ§ͺ |
${pageReferrer} |
document.referrer |
v3.2.0 π§ͺπ§ͺ |
${pageLang} |
document.documentElement.lang |
v3.2.0 π§ͺπ§ͺ |
${pageCanonicalUrl} |
<link rel="canonical" href="..."> |
v3.1.0 π§ͺπ§ͺ |
${pageImageSrc} |
<link rel="image_src" href="..."> |
v3.1.0 π§ͺπ§ͺ |
${pageDescription} |
${metaDescription} or ${ogDescription}
|
v3.1.0 π§ͺπ§ͺ |
${pageH1} |
<h1>...</h1> |
v3.1.0 π§ͺπ§ͺ |
${pageHs} |
<h1>...</h1> or <h2>...</h2> or ... |
v----- π§ͺπ§ͺβ¨ |
${pageAhrefs} |
<a href="..."> |
v----- π§ͺπ§ͺβ¨ |
${pageImages} |
<img src="..."> |
v----- π§ͺπ§ͺβ¨ |
${pageURLs} |
all frame URLs | v----- π§ͺπ§ͺβ¨ |
${pageSelectionText} |
window.getSelection().toString() |
v3.1.0 π§ͺπ§ͺ |
${pageSelectionAhrefs} |
selection hrefs | v----- π§ͺπ§ͺβ¨ |
${pageSelectionSrcs} |
selection srcs | v----- π§ͺπ§ͺβ¨ |
${pagePointerAhref} |
document.elementFromPoint() , href |
v----- π§ͺπ§ͺβ¨ |
${pagePointerSrc} |
document.elementFromPoint() , src |
v----- π§ͺπ§ͺβ¨ |
${pagePrompt} |
window.prompt() β»1,2,3 |
v3.2.0 π§ͺπ§ͺ |
format | description | version |
---|---|---|
${metaCharset} |
<meta name="charset" content="..."> |
v3.1.0 π§ͺπ§ͺ |
${metaDescription} |
<meta name="description" content="..."> |
v3.1.0 π§ͺπ§ͺ |
${metaKeywords} |
<meta name="keywords" content="..."> |
v3.1.0 π§ͺπ§ͺ |
${metaGenerator} |
<meta name="generator" content="..."> |
v3.1.0 π§ͺπ§ͺ |
${metaAuthor} |
<meta name="author" content="..."> |
v3.1.0 π§ͺπ§ͺ |
${metaCopyright} |
<meta name="copyright" content="..."> |
v3.1.0 π§ͺπ§ͺ |
${metaReplyTo} |
<meta name="reply-to" content="..."> |
v3.1.0 π§ͺπ§ͺ |
${metaTel} |
<meta name="tel" content="..."> |
v3.1.0 π§ͺπ§ͺ |
${metaFax} |
<meta name="fax" content="..."> |
v3.1.0 π§ͺπ§ͺ |
${metaCode} |
<meta name="code" content="..."> |
v3.1.0 π§ͺπ§ͺ |
${metaTitle} |
<meta name="title" content="..."> |
v3.1.0 π§ͺπ§ͺ |
${metaBuild} |
<meta name="build" content="..."> |
v3.1.0 π§ͺπ§ͺ |
${metaCreationDate} |
<meta name="creation date" content="..."> |
v3.1.0 π§ͺπ§ͺ |
${metaDate} |
<meta name="date" content="..."> |
v3.1.0 π§ͺπ§ͺ |
${metaLanguage} |
<meta name="language" content="..."> |
v3.1.0 π§ͺπ§ͺ |
${metaApplicationName} |
<meta name="application-name" content="..."> |
v3.1.0 π§ͺπ§ͺ |
${metaThemeColor} |
<meta name="theme-color" content="..."> |
v3.1.0 π§ͺπ§ͺ |
format | description | version |
---|---|---|
${ogTitle} |
<meta property="og:title" content="..."> |
v3.1.0 π§ͺπ§ͺ |
${ogType} |
<meta property="og:type" content="..."> |
v3.1.0 π§ͺπ§ͺ |
${ogUrl} |
<meta property="og:url" content="..."> |
v3.1.0 π§ͺπ§ͺ |
${ogImage} |
<meta property="og:image" content="..."> |
v3.1.0 π§ͺπ§ͺ |
${ogSiteName} |
<meta property="og:site_name" content="..."> |
v3.1.0 π§ͺπ§ͺ |
${ogDescription} |
<meta property="og:description" content="..."> |
v3.1.0 π§ͺπ§ͺ |
${ogLocale} |
<meta property="og:locale" content="..."> |
v3.1.0 π§ͺπ§ͺ |
${ogDeterminer} |
<meta property="og:determiner" content="..."> |
v3.1.0 π§ͺπ§ͺ |
${ogAudio} |
<meta property="og:audio" content="..."> |
v3.1.0 π§ͺπ§ͺ |
${ogVideo} |
<meta property="og:video" content="..."> |
v3.1.0 π§ͺπ§ͺ |
format | description | version |
---|---|---|
${console.log(msg)} ποΈSubstitute: ${System.log()}
|
v----- π§ͺπ§ͺβ¨ | |
${window.alert(message)} ποΈ |
v----- π§ͺπ§ͺβ¨ | |
${window.confirm(message)} ποΈ |
v----- π§ͺπ§ͺβ¨ | |
${window.prompt(message,default)} ποΈSubstitute: ${pagePrompt}
|
v----- π§ͺπ§ͺβ¨ |
β» Scripting does not work on pages where content scripts do not work.
γ Example: chrome://
, mozilla.org
β» It may be changed to ${scripting.prop}
in the future.
β»1: [Show completion popup] does not work.
β»2: Does not work with mobile popup display.
β»3: ${pagePrompt}
has no timeout setting. Therefore, processing may stop.
γγ Please consider carefully when using (#66)
β» Scripting does not work on pages where content scripts do not work.
- Creating strings with multiple conditions
-
${metaTitle}
or${ogTitle}
or${pageTitle}
or${title}
${x=title}${x=Math.cond(pageTitle)}${x=Math.cond(ogTitle)}${x=Math.cond(metaTitle)}${x}
-
- If there are items, output them together with subordinate sentences.
-
...
or... θͺ¬ζγ..description.γ
...${x=' θͺ¬ζγ'.concat(ogpDescription,'γ')}${Math.cond(ogpDescription,x)}
-
- Creating a snippet
Description: ${ogpDescription.snippet(100)}
Description: ${x=ogpDescription.slice(0,100)}${x=x.trim()}${len=ogpDescription.length}${y=Math.gte(len,100)}${z=''}${z=Math.cond(y,'...')}${x.concat(z)}
- [Enable content script for main world π§ͺπ§ͺ] [v3.3.6]
- Alias, function name: scripting, main scripting, main content script
- Non-string values are treated as strings:
window.CopyTabTitleUrl?.text0?.toString() ?? ''
- Read values from main world. However, no writing is done.
- If you write a value to
window
, it may be used as fingerprinting. Please use with caution. - Possible use is to switch format on a site-by-site basis.
-
${pageText0}
or${title}${enter}${url}
${Math.cond(pageText0)}${x=title.concat(enter,url)}${Math.condn(pageText0,x)}
-
- Possible use is to write a user script to describe an overly complex format.
format | description | version |
---|---|---|
${pageText0} - ${pageText9}
|
window.CopyTabTitleUrl.text0 - .text9
|
v3.3.6 π§ͺπ§ͺ |
// ==UserScript==
// @name window.CopyTabTitleUrl.text0
// @include *
// @grant none
// ==/UserScript==
window.CopyTabTitleUrl = window.CopyTabTitleUrl || {};
window.CopyTabTitleUrl.text0 = 'main world text';
- [Enable
${text0}
-${text9}
π§ͺπ§ͺ] [v3.3.4]- Alias, function name: Text,
${textn}
- The option appears when you enable [Use Extended Edit Mode π§ͺ].
- Alias, function name: Text,
format | description | version |
---|---|---|
${text0} - ${text9}
|
free input string ("}" can be included.) | v3.1.0 v3.3.4 π§ͺπ§ͺ |
- [Enable
${menu}
π§ͺπ§ͺ] [v3.4.1]- Alias, function name: Extended Context Menu,
${menu}
- You must enable [Enable programmable format π§ͺπ§ͺ][Enable
${text0}
-${text9}
π§ͺπ§ͺ] to use it. -
${text0}
=${menu=true}${menuTitle='format10'}${menuTarget='tab'}[${title}](${url})
- Expansion to format strings needs to be considered. (if there is a strong demand, we will consider it)
- If you need this feature, please let me know how to use it. (how many, format)
- Alias, function name: Extended Context Menu,
format | description | version |
---|---|---|
${menu} |
true / "true"
|
v3.4.1 π§ͺπ§ͺ |
${menuType} |
normal / separator / default:normal
|
v3.4.1 π§ͺπ§ͺ |
${menuTarget} |
tab / window / all / default:tab
|
v3.4.1 π§ͺπ§ͺ |
${menuTitle} |
Title text (default: formatn ) |
v3.4.1 π§ͺπ§ͺ |
${menuContexts} |
["page","selection"] (default: user setting) β»1 |
v3.4.1 π§ͺπ§ͺ |
${menuDocumentUrlPatterns} |
["*://example.com/*"] (default: none) β»2 |
v3.4.1 π§ͺπ§ͺ |
${menuTargetUrlPatterns} |
["*://*.example.com/*","*://*.example.net/*"] (default: none) β»2 |
v3.4.1 π§ͺπ§ͺ |
β»1: see https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/menus/ContextType
β»2: see https://developer.chrome.com/docs/extensions/develop/concepts/match-patterns
- Set the start and end text of the text to copy π§ͺπ§ͺ [v3.4.3]
- Alias, function name:
${copyStartText}
,${copyEndText}
- You must enable [Enable programmable format π§ͺπ§ͺ] to use it.
- Enable JSON format for objects and arrays.
- separator =
${startText='["'}", "${endText='"]'}
- separator =
${startText='{'}, ${endText=String.fromCharCode(125)}
- separator =
- Alias, function name:
format | description | version |
---|---|---|
${copyStartText} |
start text to copy | v3.4.3 π§ͺπ§ͺ |
${copyEndText} |
end text to copy | v3.4.3 π§ͺπ§ͺ |
${copySeparator} |
separator to copy | v3.4.3 π§ͺπ§ͺ |
- There is a function to delete the spaces of line feed characters that are automatically inserted when copying and pasting to the options screen. This is useful when writing complex formats.
- [Remove newlines when paste π§ͺπ§ͺ]
- For processes that are too complex, consider using external programs, user scripts, or bookmarklets.
- The following functions allow you to decorate the output. This is useful when having external programs read data.
-
${copyStartText}
,${copyEndText}
,${copySeparator}
-
- The following functions allow you to copy input from user scripts.
- This makes writing complex code easier.
- Additionally, browser actions, context menus, and shortcut key launch actions become available.
-
${pageText0}
-${pageText9}
- A sample user script or bookmarklet is shown below. Please consider copying without using this extension.
- The following functions allow you to decorate the output. This is useful when having external programs read data.
(function() {
window.addEventListener('copy', function(event) {
event.preventDefault();
event.stopImmediatePropagation();
var text = '['+document.title+']('+document.URL+')';
event.clipboardData.setData('text/plain', text);
}, {capture:true, once:true});
document.execCommand('copy');
})();
javascript:(function(){window.addEventListener('copy',function(a){a.preventDefault();a.stopImmediatePropagation();a.clipboardData.setData('text/plain','['+document.title+']('+document.URL+')')},{capture:!0,once:!0});document.execCommand('copy')})();