以前書いた「Microsoft EdgeでWebページを開くインターネットショートカット」や「Microsoft Edgeを起動するVBScript」で紹介している、Microsoft Edgeを起動するための文字列「microsoft-edge:」、これは一体何なのか調べてみました。
Microsoft Edgeのマニフェストファイル
上記文字列を調べるに当たり、Edgeの設定等が書かれたマニフェストファイル(C:\Windows\SystemApps\Microsoft.MicrosoftEdge_8wekyb3d8bbwe\AppxManifest.xml)を開いたところ、下記(一部抜粋)のようになっていました。
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:wincap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/windowscapabilities" xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" IgnorableNamespaces="uap mp wincap rescap">
<Identity Name="Microsoft.MicrosoftEdge" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" Version="20.10240.16384.0" ProcessorArchitecture="neutral" />
<mp:PhoneIdentity PhoneProductId="395589fb-5884-4709-b9df-f7d558663ffd" PhonePublisherId="95d94207-0c7c-47ed-82db-d75c81153c35" />
<Properties>
<DisplayName>ms-resource:AppName</DisplayName>
<PublisherDisplayName>Microsoft Corporation</PublisherDisplayName>
<Logo>Assets\MicrosoftEdgeSquare50x50.png</Logo>
</Properties>
<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.10100.0" MaxVersionTested="10.0.10100.0" />
</Dependencies>
<Resources>
<Resource Language="en-US" />
</Resources>
<Applications>
<Application Id="MicrosoftEdge" Executable="MicrosoftEdge.exe" EntryPoint="MicrosoftEdge.App">
<uap:VisualElements DisplayName="ms-resource:AppName" Square150x150Logo="Assets\MicrosoftEdgeSquare150x150.png" Square44x44Logo="Assets\MicrosoftEdgeSquare44x44.png" Description="ms-resource:AppDescription" BackgroundColor="#0078D7">
<uap:DefaultTile ShortName="ms-resource:AppName" Square310x310Logo="Assets\MicrosoftEdgeSquare310x310.png" Wide310x150Logo="Assets\MicrosoftEdgeWide310x150.png" Square71x71Logo="Assets\MicrosoftEdgeSquare71x71.png">
<uap:ShowNameOnTiles>
<uap:ShowOn Tile="square150x150Logo" />
<uap:ShowOn Tile="wide310x150Logo" />
<uap:ShowOn Tile="square310x310Logo" />
</uap:ShowNameOnTiles>
</uap:DefaultTile>
<uap:SplashScreen Image="Assets\MicrosoftEdgeSplashScreen620x300.png" BackgroundColor="#0078D7" />
</uap:VisualElements>
<Extensions>
<uap:Extension Category="windows.protocol">
<uap:Protocol Name="http" />
</uap:Extension>
<uap:Extension Category="windows.protocol">
<uap:Protocol Name="https" />
</uap:Extension>
<uap:Extension Category="windows.protocol">
<uap:Protocol Name="read" />
</uap:Extension>
<uap:Extension Category="windows.protocol">
<uap:Protocol Name="microsoft-edge" />
</uap:Extension>
<uap:Extension Category="windows.fileTypeAssociation">
<uap:FileTypeAssociation Name="html">
<uap:SupportedFileTypes>
<uap:FileType ContentType="text/html">.htm</uap:FileType>
<uap:FileType ContentType="text/html">.html</uap:FileType>
</uap:SupportedFileTypes>
<uap:Logo>Assets\MicrosoftEdgeFile.png</uap:Logo>
</uap:FileTypeAssociation>
</uap:Extension>
<uap:Extension Category="windows.fileTypeAssociation">
<uap:FileTypeAssociation Name="pdf">
<uap:SupportedFileTypes>
<uap:FileType ContentType="application/pdf">.pdf</uap:FileType>
</uap:SupportedFileTypes>
<uap:Logo>Assets\MicrosoftEdgePDF.png</uap:Logo>
</uap:FileTypeAssociation>
</uap:Extension>
<uap:Extension Category="windows.appService" EntryPoint="SpModel.Model.RetailDemoTask">
<uap:AppService Name="Microsoft-RetailDemo-Provision" />
</uap:Extension>
</Extensions>
</Application>
</Applications>
…
これを見ると答えがズバリ書いてありますね。
<uap:Extension Category="windows.protocol"> <uap:Protocol Name="microsoft-edge" /> </uap:Extension>
uap:Protocol要素の説明にある通り、アプリに関連付けられたURIスキームです。
Universal Windows Platform (UWP)アプリの開発には明るくないのですが、「Handle URI activation」を見る限り、マニフェストで設定しておけば“bingmaps:”のように指定したURIとアプリを結びつけることができるみたいですね。
これはなかなか便利だと思います。
ちなみに「Reserved file and URI scheme names」には、すでに予約されていて勝手に使うことのできないURIスキーム名が載っています。
逆に、これらのスキームを使うとWindowsの設定などが呼び出せるので、覚えておいても損は無さそうですね!

![[Windows 10]スケッチパッドを起動するショートカット](https://www.ka-net.org/blog/wp-content/uploads/eyecatch-Windows-120x120.png)















この記事へのコメントはありません。