/*
* @title 通知の行かない なんちゃって引用ツイート
* @description Twitterで引用ツイートを嫌がる方のツイートを引用したい場合に使ってみる?
* @include https://twitter.com/*/status/*
* @include https://mobile.twitter.com/*/status/*
* @license MIT License
* @require
* @javascript_url
*/
( () => {
const
width = 1024,
height = 768;
let matches = new URL( location.href ).pathname.match( /^\/([^/]+)\/status\/(\d+)/ );
if ( ! matches ) return;
let screen_name = matches[ 1 ],
id_str = matches[ 2 ],
id = BigInt( id_str ),
query = 'from:' + screen_name + ' since_id:' + (id - 1n ) + ' max_id:' + id,
url = 'https://twitter.com/search?f=live&q=' + encodeURIComponent( query );
window.open( 'https://twitter.com/intent/tweet?url=' + encodeURIComponent( url ),
'_blank',
[
'width=' + width,
'height=' + height,
'left=' + ( window.innerWidth - width ) / 2,
'top=' + ( window.innerHeight - height ) / 2,
'scrollbars=yes',
'resizable=yes',
'toolbar=no',
'location=yes',
].join( ',' )
);
} )();