SSブログ
メール投稿 ブログトップ
前の10件 | -

Outlookメールの仕様変更に伴いuserContent.cssを使ってカスタマイズ [メール投稿]


とりあえず、userContent.cssに次のように書いた。(何度か変更し、最近は2016/11/3に変更した。)
@-moz-document domain("outlook.live.com") {
    span{font-size:14px!important;}
    .PlainText{font-size:14pt!important;}
    ._lvv2_A1,._lvv2_B1,._lvv2_x1,._lvv2_y1,._lvv2_z1{height:50px!important;}
/*    ._lvv2_K1,._lvv2_L1{display:none!important;} */
    ._lvv2_L1{display:none!important;}
    ._lvv2_J1{width:80%!important;}
    .ms-fcl-ns,.ms-fcl-tp,.ms-fwt-sb{font-size:10px!important;}
    ._n_O4,._n_L4{display:none!important;}
    ._n_N4,._n_K4{bottom: 0px!important;}
}

リスト部分の行間をもっと縮めたかったのだけど、分からなかった。
とりあえず、リストの差出人情報が大きかったのを小さくできて、
リストに表示されていたメール本文の一部を消して、
リストに表示するメール件数を増やせた。
リストに表示されるメールの件名が短かったのも長くした。
そして、テキストメールの文字サイズを大きくした。
nice!(0)  コメント(0)  トラックバック(0) 
共通テーマ:moblog

私が作ったFirefoxのブックマークレットがsubstr()の所で無反応になる。 [メール投稿]

正己さんはTwitterを使っています: "ブックマークレットを作ってるのだけど、なぜか.substr()が使えない。.substring()も使えない。取り除くと反応するのだけど、書いておくと反応しない。何か間違ってるんだろうなぁ。"
...


 例えば、次のスクリプトのどこが間違っているのだろう?
javascript:(function(){var%20url=document.getSelection();if(url.substr(0,4)=='http'){window.open('view-source:'+url);}else%20if(url!=''){window.open('view-source:http://'+url);}else{window.open('view-source:'+document.location.href);}})();

 Firefoxのブックマークレット【URLのソースを表示】にしてクリックすると全く反応しない。
 次のように .substr(0,4) を取り除けば反応する。【未完成】
javascript:(function(){var%20url=document.getSelection();if(url=='http'){window.open('view-source:'+url);}else%20if(url!=''){window.open('view-source:http://'+url);}else{window.open('view-source:'+document.location.href);}})();

 このブックマークレットはほとんど必要なくなったけれど、原因が分からないと気持ち悪い。どこが間違っているのだろう?
 


↓↓↓ 問題解決 ↓↓↓


nice!(0)  コメント(0)  トラックバック(0) 
共通テーマ:moblog

Firefox 41.0.2でShockwave Flash プラグインがクラッシュするサンプル [メール投稿]


 クラッシュするサンプルと似たソースなのにクラッシュしないサンプル。
20151017.html(XHTML 1.0 Transitionalでobject使用、クラッシュ未確認)
20151017_2.html(object使用、<param name="wmode" value="transparent" />削除。クラッシュする)
20151017_html5.html(html5でembed使用、クラッシュする)
20151017_html5_2.html(html5でembed使用、wmode="transparent" 追加。クラッシュ未確認)
20151017_html5_3.html(html5でobject使用、<param name="wmode" value="transparent">あり。クラッシュ未確認)
複数のフラッシュ動画が表示されているページで、動画を交互にクリックすると Shockwave Flash プラグインがクラッシュするサンプル。

nice!(0)  コメント(0)  トラックバック(0) 
共通テーマ:moblog

Ustreamの動画をウィンドウの右下に表示するソース [メール投稿]



 とりあえず、作った。簡易版なのでヘッダは適当。
 ウインドウサイズは1680×1050が前提。IE11での利用を想定。
<html lang="ja">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<title>USTREAM</title>
<script type="text/javascript">
function newsrc() {
var url="http://www.ustream.tv/embed/" +document.ust.ustid.value+ "?html5ui=1";
document.getElementById("Ustream").src = url;
}
</script>
</head>
<body>
<iframe width="360" height="203" src="" allowfullscreen="true" webkitallowfullscreen="true" scrolling="no" frameborder="0" style="border: 0px none transparent;" name="Ustream" id="Ustream"></iframe>
<br />
<form id="ust" name="ust">
<a href="http://www.ustream.tv" style="font-size: 12px; line-height: 20px; font-weight: normal; text-align: left;" target="_blank">Ustream</a>
<input type="text" id="ustid" name="ustid" style="width:200px;" />
<a href="javascript:newsrc();" style="font-size:12px;">開く</a>
<a href="#" onclick="window.open('Ustream.htm','','width=370,height=223,left=1310,top=827,location=yes,resizable=yes');return false;" style="font-size:12px;">追加</a>
</form>
</body>
</html>

 Ustream.htmの所は自分の作ったhtmlファイルの名前。
 ブックマークレットのリンクは次の通り。
javascript:(function(){window.open('Ustream.htm','','width=370,height=223,left=1310,top=827,location=yes,resizable=yes');})();

 Ustream.htmの所は自分の作ったhtmlファイルのURL。
 ウインドウの入力欄にはチャンネル名ではなく、埋め込みコードのsrc=""の中にあるURLの/embed/の後ろの数字を入れる。「開く」をクリックすると、白紙の所に動画が表示される。動画は、クリックしないと開始しない。
 ウインドウの「追加」をクリックすると同じ大きさの白紙のウインドウが同じ位置に表示される。ドラッグ&ドロップで別の位置に持って行って、入力欄に該当の数字を入力して「開く」をクリックして別の動画を同時に見る。

続きを読む


nice!(0)  コメント(0)  トラックバック(0) 
共通テーマ:moblog

ツイッターでブックマークレットが使えなくなった件 [メール投稿]



 ツイッターのstatusページでリロードのためのブックマークレットや引用ツイートのためのブックマークレットや、さらにはメールでブログに記事をアップロードするためのブックマークレットや、その他いろいろとブックマークレットを使っていたのだけど、Firefox 40.0にアップデートしてから使えなくなった。
 以前にブログ【Firefoxのブックマークレットが使えないサイトがある】で書いたように、Content Security Policy (CSP) が原因らしいが、それならばと、例えば上のツイートのHTTPヘッダを見てみたら、CSPの所は次のように書いてあった。
Content-Security-Policy: default-src 'self'; connect-src 'self' https://upload.twitter.com https://analytics.twitter.com https://pay.twitter.com https://graph.facebook.com; font-src 'self' https://*.twimg.com https://twitter.com https://ton.twitter.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com https://netdna.bootstrapcdn.com data:; frame-src 'self' https://*.twimg.com https://twitter.com https://ton.twitter.com twitter: https://www.youtube.com https://vine.co https://upload.twitter.com https://platform.twitter.com https://syndication.twitter.com https://s-static.ak.facebook.com https://www.facebook.com https://pay.twitter.com; img-src 'self' https://*.twimg.com https://twitter.com https://ton.twitter.com blob: https://syndication.twitter.com https://www.google.com https://www.google-analytics.com https://stats.g.doubleclick.net https://www.facebook.com https://graph.facebook.com https://fbcdn-profile-a.akamaihd.net https://*.fbcdn.net data:; media-sr c 'self' https://*.twimg.com https://twitter.com https://ton.twitter.com blob:; object-src https://twitter.com https://pbs.twimg.com; script-src 'unsafe-inline' 'unsafe-eval' 'self' https://*.twimg.com https://twitter.com https://ton.twitter.com https://platform.twitter.com https://syndication.twitter.com https://analytics.twitter.com https://www.google-analytics.com https://ssl.google-analytics.com https://connect.facebook.net https://cm.g.doubleclick.net https://api.twitter.com https://graph.facebook.com https://www.google.com; style-src 'unsafe-inline' 'self' https://*.twimg.com https://twitter.com https://ton.twitter.com https://fonts.googleapis.com https://maxcdn.bootstrapcdn.com https://netdna.bootstrapcdn.com https://translate.googleapis.com https://platform.twitter.com; report-uri https://twitter.com/i/csp_report?a=NVQWGYLXFVZXO2LGOQ%3D%3D%3D%3D%3D%3D&ro=false;

 重要な所は強調文字にしておいたが、「script-src」の所に「unsafe-inline」がある。これが含まれていれば、ブックマークレットが使えるんじゃないかと思っていたのだが、私の勘違いかもしれない。
 最新の【Content Security Policy Level 2】で関係ありそうなところを引用する。
7. Directives

This section describes the content security policy directives introduced in this specification. Directive names are case insensitive.

In order to protect against Cross-Site Scripting (XSS), web application authors SHOULD include:

both the script-src and object-src directives, or
include a default-src directive, which covers both scripts and plugins.

In either case, authors SHOULD NOT include either 'unsafe-inline' or data: as valid sources in their policies. Both enable XSS attacks by allowing code to be included directly in the document itself; they are best avoided completely.

 英語は苦手なのでよく分からないが「unsafe-inline」を含めるべきじゃないと書いてあるような気がする。
7.15. script-src

The script-src
directive restricts which scripts the protected resource can execute. The directive also controls other resources, such as XSLT style sheets [XSLT], which can cause the user agent to execute script. The syntax for the name and value of the directive are described by the following ABNF grammar:

directive-name = "script-src"
directive-value = source-list

The term allowed script sources
refers to the result of parsing the script-src directive’s value as a source list if the policy contains an explicit script-src, or otherwise to the default sources.

If 'unsafe-inline' is not in the list of allowed script sources, or if at least one nonce-source or hash-source is present in the list of allowed script sources:

Whenever the user agent would execute an inline <script> from a script element that lacks a valid nonce and lacks a valid hash for the allowed script sources, instead the user agent MUST NOT execute script, and MUST report a violation.
Whenever the user agent would execute an inline script from an inline event handler, instead the user agent MUST NOT execute script, and MUST report a violation.
Whenever the user agent would execute script contained in a javascript URL, instead the user agent MUST NOT execute the script, and MUST report a violation.

 よく分からない。
 それで、ページ内をbookmarkletで検索したら次のように書いてあった。
Note: User agents may allow users to modify or bypass policy enforcement through user preferences, bookmarklets, third-party additions to the user agent, and other such mechanisms.

 Google翻訳では次のようになる。
注:ユーザーエージェントは、ユーザーがユーザーの好み、ブックマークレット、ユーザエージェントに、サードパーティ製の追加、および他のそのような機構を介して変更またはバイパスポリシーの適用を可能にすることができます。

 ブックマークレットを使っている場合はCSPを無視させてもいいよ、と読めるのだけど、「may allow」であって、無視させることを推奨してないみたいだから、Firefoxとしては、無視しないことにしたのだろう。
 それで、ツイッターのHTTPヘッダの「script-src」に「unsafe-inline」があるけれど、これを無視することにしたのだろう。
 あっ、そもそも「unsafe-inline」の意味が分かってない。

 結論。よく分からない。とにかく、これはツイッターのHTTPヘッダのCSPの所に何が書いてあったかメモしたかっただけ。
nice!(0)  コメント(0)  トラックバック(0) 
共通テーマ:moblog

1194055 – Size of <input> elements has changed in Firefox 40 を見て [メール投稿]

1194055 – Size of <input> elements has changed in Firefox 40
...
Brian Birtles (:birtles) 2015-08-12 21:47:43 PDT

We're seeing reports on twitter in Japan of layouts breaking in Firefox 40 due to the sizing of <input type="text"> and <textarea> elements.

One report suggests the default font might have changed.[1]

For the test URL the following difference is reported:
ESR38: https://pbs.twimg.com/media/CMQyxHKUEAA2CBm.png:large
40: https://pbs.twimg.com/media/CMQy27dU8AAtJ-a.png:large

[1] https://twitter.com/gooey_archer/status/631658186454401025
...

 Firefoxを40.0にアップデートしたら、Firefoxのスタートページに指定してある私が作ったWebページの検索フォームの入力エリアが、ビヨーンと右に倍近く伸びていた。何が起こったのか分からなかったのだが、ツイッターで検索するなどして辿り着いたのが上のページ。
 どうやら、Firefoxのデフォルトフォントが変わったらしい。
Jonathan Kew (:jfkthame) 2015-08-13 00:45:19 PDT

The fact that the default font for these elements changed is expected; we were using a deprecated API and getting an old default. I note that viewing the testcase from the URL in IE 11 on Win8.1 gives me a result that's closer to our "new" behavior than our "old".

In general, I'm seeing substantial differences between browsers/platforms with the testcase, illustrating the fact that relying on a specific default size of <input> elements is extremely fragile. Authors who want a specific size should be explicitly specifying it.

Is there some reason this is particularly problematic in Japan? (What was the old font being used, what is the new font, and -- aside from the effect on size -- is the new font better/worse than the old one? How does it compare to what IE uses?)

 それで、以前はどのフォントで、今はどのフォントかであるが、議論中に次のように書いてある。
Masayuki Nakano (:masayuki) (Mozilla Japan) 2015-08-13 03:07:16 PDT

I think that the main problem is, the old Japanese UI font "MS UI Gothic" and new Japanese UI font "Meiryo UI" have very different size and glyph. A character size of Meiryo UI is too large. That must cause breaking a lot of web sites' layout.

Edge still uses "MS UI Gothic" for the default style of <input> according to the testcase. So, we should not use "true" system font on Win8 or later.

 英語なのでよくわからないが、"MS UI Gothic"から"Meiryo UI"に変わったように読める。それならば、スタイルシートのfont-familyプロパティで指定すれば、以前の状態と比較できるかもしれない。アップデート前のFirefoxが無いので、どの程度変わったか比較できずに困っていた。
それで、次のソースを使って比較してみた。
<body style="background-color:silver;">
<input type="text" name="name" size="60"><span>指定なし</span><br />
<input type="text" size="60" style="font-family: 'MS ゴシック';"><span>MS ゴシック</span><br />
<input type="text" size="60" style="font-family: 'MS Gothic';"><span>MS Gothic</span><br />
<input type="text" size="60" style="font-family: 'MS Pゴシック';"><span>MS Pゴシック</span><br />
<input type="text" size="60" style="font-family: 'MS PGothic';"><span>MS PGothic</span><br />
<input type="text" size="60" style="font-family: 'MS UI Gothic';"><span>MS UI Gothic</span><br />
<input type="text" size="60" style="font-family: 'メイリオ';"><span>メイリオ</span><br />
<input type="text" size="60" style="font-family: 'Meiryo';"><span>Meiryo</span><br />
<input type="text" size="60" style="font-family: 'Meiryo UI';"><span>Meiryo UI</span><br />
<input type="text" size="60" style="font-family: 'serif';"><span>serif</span><br />
<input type="text" size="60" style="font-family: 'sans-serif';"><span>sans-serif</span><br />
<input type="text" size="60" style="font-family: 'monospace';"><span>monospace</span><br />
</body>

 Firefoxのフォントの設定でも変わってくるかもしれないで、それを変えて試してみた。
 その結果が次のツイート。


 "MS UI Gothic"から"Meiryo UI"ではなく、"MS Gothic"から"Meiryo"に変わったような気がする。

続きを読む


nice!(0)  コメント(0)  トラックバック(0) 
共通テーマ:moblog

ひょっとして最悪…「朝型勤務」がダメな理由:日本経済新聞 を見て [メール投稿]

ひょっとして最悪…「朝型勤務」がダメな理由  :日本経済新聞
 朝型勤務の問題点をまとめると、(1)睡眠リズムを朝型にする(前倒しする)のは体内時計のメカニズムからみてハードルが高い、(2)結果的に現状でも限界に近い睡眠不足をさらに悪化させる可能性がある、(3)朝型勤務に適応しにくい労働者が少なからず存在する、(4)特に体質的な夜型傾向の強い人では適応しきれず心身の不調を引き起こしかねない、などが挙げられる。不眠や生活習慣病など持病のある人はさらに健康管理が難しくなるだろう

 全文をコピーしたいが、まとめの部分だけ。
 それから、読みながらツイートしたので、その一番最初。次のツイートに続いていくつかツイートした。


nice!(0)  コメント(0)  トラックバック(0) 
共通テーマ:moblog

Firefoxでwindow.setTimeoutを使ってもポップアップブロックされないスクリプトの一例 [メール投稿]

ポップアップブロックの設定とトラブルシューティング | Firefox ヘルプ
ポップアップウィンドウ をブロックする: ポップアップブロックをすべて無効にするには、このオプション のチェックを外してください

 私はFirefoxのオプションの「コンテンツ」パネルで「ポップアップウィンドウ をブロックする」のチェックを外して使っているのだが、チェックした状態でも、window.open()でポップアップを開こうとするページでポップアップをブロックしないことがあり、いろいろな方法があるようだが、難しくてよく分からない。
 window.open()はページを開いた時に実行されるようだとブロックされるのだが、リンクタグ<a>でonclickを使って開く時はブロックされないらしい。でも、window.setTimeoutを使うとブロックされるらしい。
 でも、window.setTimeoutを使っても、1秒以内ならブロックされなかったり、window.setTimeoutを使わずにポップアップウインドウが表示されていて、そこに名前が付けられていて、その名前のウインドウにwindow.setTimeoutで開いた場合はブロックされないらしい。
 頭が混乱してよく分からないのだが、とにかく、次のようなスクリプトを作って試してみた。

<script type="text/javascript">
<!--
function sample1() {
var popup = window.open("","","width=600,height=500");
var addscript = document.createElement('script');
addscript.type = "text/javascript";
var text = document.createTextNode('window.name="sample"');
addscript.appendChild(text);
popup.document.body.appendChild(addscript);
}
function sample2() {
window.open("http://www002.upp.so-net.ne.jp/self/","sample");
}
function sample3() {
window.open("http://www002.upp.so-net.ne.jp/self/","sample","width=600,height=500");
}
// -->
</script>
<a onclick='sample1();window.setTimeout(function() {sample2();},1);'>(1/1000)秒後にポップアップで私のサイトを開く</a><br />
<a onclick='sample1();window.setTimeout(function() {sample2();},1000);'>1秒後にポップアップで私のサイトを開く</a><br />
<a onclick='sample1();window.setTimeout(function() {sample2();},2000);'>2秒後にポップアップで私のサイトを開く</a><br />
<a onclick='window.setTimeout(function() {sample3();},1000);'>1秒後にポップアップで私のサイトを開く</a><br />
<a onclick='window.setTimeout(function() {sample3();},2000);'>2秒後にポップアップで私のサイトを開く(ポップアップブロック対象)</a><br />


以下は、上のスクリプトをこの記事に張り付けてみたもの。
(1/1000)秒後にポップアップで私のサイトを開く
1秒後にポップアップで私のサイトを開く
2秒後にポップアップで私のサイトを開く
1秒後にポップアップで私のサイトを開く
2秒後にポップアップで私のサイトを開く(ポップアップブロック対象)


続きを読む


nice!(0)  コメント(0)  トラックバック(0) 
共通テーマ:moblog

Firefoxのwindow.openの謎(同じ名前のウインドウやタブで開いたり開かなかったり) [メール投稿]

正己さんはTwitterを使っています: "謎は一つ解けたが、同じ名前で開く場合と開かない場合があること、同じJavascriptなのにウインドウが開く場合とタブで開く場合があること、ウインドウで開けば同じウインドウで開くのにタブだと別のタブで開いてしまうことの理由が分かってない。"
...

こんなソースを作って試してみた。
<html>
<head>
<script type="text/javascript" language="javascript">
<!--
function sample1() {
window.open("http://www002.upp.so-net.ne.jp/self/","sample","width=600,height=500");
}
function sample2() {
window.open("http://www.geocities.jp/selfmirror7777/robamimi/roba0000.html","sample");
}
function sample3() {
window.open("http://self.blog.so-net.ne.jp/","sample");
}
function sample4() {
window.open("http://self.blog.so-net.ne.jp/","sample","width=600,height=500");
}
function sample5() {
window.open("http://www.rakuten.co.jp/","sample");
}
function sample6() {
window.open("http://www.rakuten.co.jp/","sample","width=600,height=500");
}
// -->
</script>
</head>
<body>
<a onclick="sample1()">ウインドウサイズを指定して私のサイトを開く</a><br />
<a onclick="sample2()">ウインドウサイズを指定せず私の独り言を開く</a><br />
<a onclick="sample3()">ウインドウサイズを指定せず私のブログを開く</a><br />
<a onclick="sample4()">ウインドウサイズを指定して私のブログを開く</a><br />
<a onclick="sample5()">ウインドウサイズを指定せず楽天市場を開く</a><br />
<a onclick="sample6()">ウインドウサイズを指定して楽天市場を開く</a><br />
</body>
</html>

 同じ"sample"という名前なのに、別のウインドウで開いたり、別のタブで開いたりする。
 Firefoxでは about:config の browser.link.open_newwindow.restriction がデフォルトで 2 になっていて、それではJavascriptでウインドウサイズを指定しないと新しいタブで開くらしい。
 だから上のスクリプトで最初にsample2()を実行した場合はタブで開く。ただし、先にsample1()を実行すると同じ名前のウインドウで開く。それは正常。また、先にsample2()を実行した後でsample1()を実行するとウインドウではなくsample2()で開いたタブに開く。たぶんそれも正常。
 しかし、sample3()、sample4()をクリックして、いろいろな順番で試してほしい。わけが分からなくなる。
 いったい、どのようなルールになっているのだろう?
 以下は、上のスクリプトのリンク。
ウインドウサイズを指定して私のサイトを開く
ウインドウサイズを指定せず私の独り言を開く
ウインドウサイズを指定せず私のブログを開く
ウインドウサイズを指定して私のブログを開く
ウインドウサイズを指定せず楽天市場を開く
ウインドウサイズを指定して楽天市場を開く

続きを読む


nice!(0)  コメント(0)  トラックバック(0) 
共通テーマ:moblog

ツイッターでアップロードした画像のオリジナル画像を表示するブックマークレット [メール投稿]

正己さんはTwitterを使っています: "ツイッターでオリジナル画像を表示する→ javascript:(function(){var%20url=document.location.href;url='https:'+url.split(':')[1]+':orig';window.open(url);})();"
...

 ツイッター本家でアップロードした画像は、今のところ、
 https://pbs.twimg.com/media/ファイル名(jpg、png、他)
 らしく、このURLの末尾にサイズを指定する :large、:small、:medium、:thumb、:orig の付いたURLもある。
 大きなサイズの画像をアップロードすると縮小されて表示されてることがある。URLにサイズ指定が無いのにアップロードしたオリジナルのサイズで表示されないことがある。サイズ指定の :orig がオリジナルの画像かもしれないので、サイズ指定がなかったり、:large、:small、:medium、:thumb がURLの末尾についている画像を :orig が付いた
 https://pbs.twimg.com/media/ファイル名(jpg、png、他):orig
にして表示するのを容易にしたい。
 そこで、ブックマークレットを作った。IE11でも使えるらしい。ただし、画像がツイートに埋め込まれた状態ではなく、画像だけが表示された状態でしか利用できない。上のようにツイートにスクリプトは残してあるが、忘れちゃうかもしれないのでブログに残す。
 ブックマークレット→ 【to_orig
 

続きを読む


nice!(0)  コメント(0)  トラックバック(0) 
共通テーマ:moblog
前の10件 | - メール投稿 ブログトップ

この広告は前回の更新から一定期間経過したブログに表示されています。更新すると自動で解除されます。