Overlay browser preferences from firefox extension - firefox

I'm trying to add a overlay to the preferences of the browser from my extension without success. Nothing is displayed when my plugin is installed. Other xul files show correctly (for example a preferences dialog of the plugin. I tried to adapt this tutorial to my needs.
I register the overlay in chrome.manifest:
content smime chrome/content/
overlay chrome://browser/content/preferences/preferences.xul chrome://smime/content/preferences.xul
The preferences.xul:
<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<!-- Merge with the BrowserPreferences Window -->
<prefwindow id="BrowserPreferences">
<!-- Create a new pane (tab) for HP Scheduler. -->
<prefpane id="hpschedPane" label="&prefpane.label;"
image="chrome://smime/content/sogo-48.png">
<!-- Intermediary between GUI and preferences system -->
<preferences>
<preference id="sodgeItSmimeKeyfile" name="extensions.sodgeItSmime.keyfile" type="text"/>
</preferences>
<!-- GUI Elements... -->
<groupbox>
<caption label="Settings"/>
<grid>
<columns>
<column flex="4"/>
<column flex="1"/>
</columns>
<rows>
<row>
<label control="keyfile" value="Keyfile"/>
<textbox id="keyfile" preference="sodgeItSmimeKeyfile"/>
</row>
</rows>
</grid>
</groupbox>
</prefpane>
</prefwindow>
</overlay>
This is what I want to do - add a tab in the Firefox settings dialog.
Edit: added image to describe what I'm trying to do

It's trickier to get this to work than it should be. You might try the following approach, which we use in our FireTorrent extension:
Overlay the Firefox preference window as shown:
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://firetorrent/skin/firetorrent-prefs.css" type="text/css"?>
<overlay id="FiretorrentPaneOverlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<prefwindow id="BrowserPreferences">
<prefpane id="paneFiretorrent" label="FireTorrent"
src="chrome://firetorrent/content/optionsOverlay.xul"/>
</prefwindow>
</overlay>
Add the following to your CSS file (firetorrent-prefs.css in the example):
#BrowserPreferences radio[pane="paneFiretorrent"] {
list-style-image: url("chrome://firetorrent/skin/firetorrent-icon-32.png");
}
Contents of optionsOverlay.xul as follows:
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<?xml-stylesheet href="chrome://global/skin/preferences.css" type="text/css"?>
<?xml-stylesheet href="chrome://firetorrent/skin/options.css" type="text/css"?>
<!DOCTYPE overlay SYSTEM "chrome://firetorrent/locale/optionsOverlay.dtd">
<overlay id="firetorrentOptionsOverlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<prefpane id="paneFiretorrent" onpaneload="loadOptions();" flex="1">
<preferences>
<preference id="firetorrent.options.port" name="extensions.firetorrent.port" type="int"/>
...etc...
</preferences>
<script type="application/x-javascript" src="chrome://firetorrent/content/optionsOverlay.js"/>
...all your prefpane XUL here...
</prefpane>
</overlay>
It's been a long time since I wrote this, but I believe the important things to note are that the overlay for preferences.xul (point 1 in my example) references another XUL overlay that contains the actual prefpane (optionsOverlay.xul) and that you need to use the list-style-image style in CSS to specify the icon for your new tab.

Related

Rebuild/Recreate a user profile using Microsoft USMT tool on Windows

In some special cases, we need to re-create a new local profile for a user, and then re-import some files/folders/HKCU registry keys from his former profile.
The process we'd like to use :
- Full backup of old user profile (anything, files, registry)
- Delete the C:\Users\ folder and profile infos in registry
- Re-import some files and reg key (not all)
Some guys pointed out that Microsoft has a tool for this called USMT and i tried the following :
- Save the whole user profile using this XML config :
<?xml version="1.0" encoding="UTF-8"?>
<_locDefinition>
<_locDefault _loc="locNone"/>
<_locTag _loc="locData">displayName</_locTag>
</_locDefinition>
<!-- Profile files -->
<component type="Documents" context="User">
<displayName>Files Migration</displayName>
<role role="Data">
<rules>
<!-- Anything ... -->
<include>
<objectSet>
<pattern type="File">%CSIDL_PROFILE%\* [*]</pattern>
</objectSet>
</include>
<!-- ... Except -->
<unconditionalExclude>
<objectSet>
<!-- Reg files -->
<pattern type="File">%CSIDL_PROFILE%\ [NTUSER.*]</pattern>
<pattern type="File">%CSIDL_LOCAL_APPDATA%\Microsoft\Windows\ [UsrClass.dat]</pattern>
<!-- IE Cache -->
<pattern type="File">%CSIDL_INTERNET_CACHE%\* [*]</pattern>
<!-- Temp -->
<pattern type="File">%TEMP%\* [*]</pattern>
</objectSet>
</unconditionalExclude>
</rules>
</role>
</component>
<!-- Registry -->
<component type="System" context="User">
<displayName>Registry Migration</displayName>
<role role="Settings">
<rules>
<!-- Get all HCKU -->
<include>
<objectSet>
<pattern type="Registry">HKCU\* [*]</pattern>
</objectSet>
</include>
</rules>
</role>
</component>
CommandLine for saving using ScanState.exe :
/listfiles:"C:\Logs\saved.log" /i:"C:\ProgramData\RebuildProfil\Conf\UserFull.xml" /ui:*\myuser/ue:*\* /hardlink /nocompress /o /v:13
Seems to work fine so far...
After profile deletion, il use LoadState.exe with following XML :
<?xml version="1.0" encoding="UTF-8"?>
<_locDefinition>
<_locDefault _loc="locNone"/>
<_locTag _loc="locData">displayName</_locTag>
</_locDefinition>
<!-- This component migrates My Music files -->
<component type="Documents" context="User">
<displayName _locID="miguser.mymusic">My Music</displayName>
<paths>
<path type="File">%CSIDL_MYMUSIC%</path>
</paths>
<role role="Data">
<detects>
<detect>
<condition>MigXmlHelper.DoesObjectExist("File","%CSIDL_MYMUSIC%")</condition>
</detect>
</detects>
<rules>
<include filter='MigXmlHelper.IgnoreIrrelevantLinks()'>
<objectSet>
<pattern type="File">%CSIDL_MYMUSIC%\* [*]</pattern>
</objectSet>
</include>
<merge script="MigXmlHelper.DestinationPriority()">
<objectSet>
<pattern type="File">%CSIDL_MYMUSIC%\ [desktop.ini]</pattern>
</objectSet>
</merge>
</rules>
</role>
</component>
The commandline :
/i:"C:\ProgramData\RebuildProfil\Conf\MigUserProfile.xml" /ui:*\myuser /ue:*\* /hardlink /nocompress /v:13
And instead of just migrating "My Music" files, the full user profile gets recreated (all files, all registry keys), doesn't seems the infos from the XML are taken into account.
So i wonder :
1- if it is possible to specify different XML files to scanstate and loadstate
2- if it is possible to only migrate some part of what was saved in the migration store
Any advice ? Thanks !

Packaged & Installed UWP App Not In Start Menu

I generated the app package for my UWP project via sideload and installed it with the Powershell script that was made. Although the app installed and a folder was made in WindowsApps I cannot launch the app because it is not in the Start Menu. Any ideas on how to fix this?
Edit:
Applications tag in WAP Package Manifest:
<Applications>
<Application Id="App"
Executable="$targetnametoken$.exe"
EntryPoint="$targetentrypoint$">
<uap:VisualElements
DisplayName="WorksPackage2"
Description="Package"
BackgroundColor="transparent"
Square150x150Logo="Images\Square150x150Logo.png"
Square44x44Logo="Images\Square44x44Logo.png"
AppListEntry="none">
<uap:DefaultTile Wide310x150Logo="Images\Wide310x150Logo.png" />
<uap:SplashScreen Image="Images\SplashScreen.png" />
</uap:VisualElements>
<Extensions>
<uap:Extension Category="windows.appService">
<uap:AppService Name="iTunesConnection" />
</uap:Extension>
<desktop:Extension
xmlns:desktop="http://schemas.microsoft.com/appx/manifest/desktop/windows10"
Category="windows.fullTrustProcess"
Executable="iTunesConsole\iTunesConsole.exe">
</desktop:Extension>
</Extensions>
</Application>
Applications tag in UWP Manifest:
<Applications>
<Application Id="App"
Executable="$targetnametoken$.exe"
EntryPoint="Works.App">
<uap:VisualElements
DisplayName="Works"
Square150x150Logo="Assets\Square150x150Logo.png"
Square44x44Logo="Assets\Square44x44Logo.png"
Description="Works"
BackgroundColor="transparent">
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png"/>
<uap:SplashScreen Image="Assets\SplashScreen.png" />
</uap:VisualElements>
<Extensions>
<uap3:Extension Category="windows.appExtension">
<uap3:AppExtension Name="microsoft.gameBarUIExtension"
Id="YourUniqueIdHere"
DisplayName="iTunes Controller"
Description="desc"
PublicFolder="GameBar">
<uap3:Properties>
<GameBarWidget Type="Standard">
<HomeMenuVisible>true</HomeMenuVisible>
<PinningSupported>true</PinningSupported>
<Window>
<Size>
<Height>300</Height>
<Width>400</Width>
<MinHeight>150</MinHeight>
<MinWidth>200</MinWidth>
<MaxHeight>1000</MaxHeight>
<MaxWidth>1000</MaxWidth>
</Size>
<ResizeSupported>
<Horizontal>true</Horizontal>
<Vertical>true</Vertical>
</ResizeSupported>
</Window>
</GameBarWidget>
</uap3:Properties>
</uap3:AppExtension>
</uap3:Extension>
</Extensions>
</Application>
The problem is that you have:
AppListEntry="none"
which says "please don't add an entry to the Start menu."

How to set a custom icon for a file extension which shows up in the solution explorer

I'm trying to set a custom icon for a specific file extension in the solution explorer in visual studio 2019. What do i need to add to the vsix project to make it happen?
I have tried to add a imagemanifest including the new icon as a .png file and in the pkgdef hook it up to the extension, but it will not show up. I tried a lot of different things to make it work. When i set an KnowMoniker as the icon for the extension it does show up.
The manifest is set to content and include in vsix is set to true.
The icon is set to resource.
icon.imagemanifest
<?xml version="1.0" encoding="utf-8"?>
<ImageManifest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/VisualStudio/ImageManifestSchema/2014">
<Symbols>
<String Name="Resources" Value="/Test;Component/Resources" />
<Guid Name="Guid" Value="{35e0e52d-a955-451d-86e4-5813fef55368}" />
<ID Name="icon" Value="1" />
</Symbols>
<Images>
<Image Guid="$(Guid)" ID="$(icon)">
<Source Uri="$(Resources)/icon.png">
<Size Value="16" />
</Source>
</Image>
</Images>
<ImageLists />
</ImageManifest>
icon.pkgdef
[$RootKey$\ShellFileAssociations\.ext]
"DefaultIconMoniker"="35e0e52d-a955-451d-86e4-5813fef55368:1"

Desktop Windows App to include capabilities

I am trying to test the newer Geolocation API (in place of the older ILocation COM API), which is a WinRT API.
I 've followed instructions from here to allow a normal C++ desktop Win32 app to call Windows 10 RT functions. It works normally in my tests.
However, for location, I must include a capability in a XML file as discussed here.
How am I supposed to create this XML file? I tried creating a file like this:
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest">
<Capabilities>
<!-- DeviceCapability elements must follow Capability elements (if present) -->
<DeviceCapability Name="location"/>
</Capabilities>
<Identity Name=""
Version=""
Publisher="" />
<Properties>
<DisplayName></DisplayName>
<PublisherDisplayName></PublisherDisplayName>
<Logo></Logo>
</Properties>
<Prerequisites>
<OSMinVersion></OSMinVersion>
<OSMaxVersionTested></OSMaxVersionTested>
</Prerequisites>
<Resources>
<Resource Language="" />
</Resources>
<Applications>
<Application Id="" StartPage="">
<VisualElements DisplayName="" Description=""
Logo="" SmallLogo=""
ForegroundText="" BackgroundColor="">
<SplashScreen Image="" />
</VisualElements>
</Application>
</Applications>
</Package>
I am not sure what to do from now on. Is there a compiler setting that would tell the compiler/linker to include this appxmanifest file?
Thanks

How to change hardware requirements in Windows Universal App?

I developed a Windows (10) Universal App and is deployed to the Store (see here). To my surprise people can't rate it, it gives this reason: "This app needs hardware your device doesn't have, hindering app performance. Rating and reviewing is turned off."
On the bottom of the page in the Store it says "Hardware requirements: Mouse, Touch". I did not configured that anywhere, and I can't find where to change it. I checked the appmanifest with the editor, and there is no tab "Hardware requirements".
This is my appmanifest:
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" IgnorableNamespaces="uap mp">
<Identity Name="xxx" Publisher="CN=xxx" Version="1.1.10.0" />
<mp:PhoneIdentity PhoneProductId="xxxx" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
<Properties>
<DisplayName>StudioBrussel</DisplayName>
<PublisherDisplayName>BrechtB</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>
<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
</Dependencies>
<Resources>
<Resource Language="x-generate" />
</Resources>
<Applications>
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="StudioBrussel.App">
<uap:VisualElements DisplayName="Studio Brussel" Square150x150Logo="Assets\Square150x150Logo.png" Square44x44Logo="Assets\Square44x44Logo.png" Description="Listen to Studio Brussels with this app! Luister naar Studio Brussel met deze app! Écoutez Studio Brussel avec cette app!" BackgroundColor="#cb030b">
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png">
</uap:DefaultTile>
<uap:SplashScreen Image="Assets\SplashScreen.png" BackgroundColor="#cb030b" />
<uap:InitialRotationPreference>
<uap:Rotation Preference="portrait" />
<uap:Rotation Preference="landscape" />
<uap:Rotation Preference="portraitFlipped" />
<uap:Rotation Preference="landscapeFlipped" />
</uap:InitialRotationPreference>
</uap:VisualElements>
<Extensions>
<Extension Category="windows.backgroundTasks" EntryPoint="StudioBrussel.App">
<BackgroundTasks>
<Task Type="audio" />
</BackgroundTasks>
</Extension>
</Extensions>
</Application>
</Applications>
<Capabilities>
<Capability Name="internetClient" />
</Capabilities>
</Package>
Does anyone have an idea how to change it, or is this a store bug?
I found it, apparently the "hardware preferences" are not in the appmanifest anymore, but on dev.windows.com in the dashboard under submission => app properties => hardware preferences.

Resources