How to make a custom prefab preview and thumbnail?

I can create a custom game object preview, but it doesn’t work on prefabs.

[CustomPreview(typeof(GameObject))]
public class MyPreview : ObjectPreview
{
    public override bool HasPreviewGUI()
    {
        return true;
    }

    public override void OnPreviewGUI(Rect r, GUIStyle background)
    {
        GUI.Label(r, target.name + " is being previewed");
    }
}

I also need a custom thumbnail.

I have the same issue, do u’ve solved it?

Same issue.
The prefab preview branching Its probably hard coded.