As a two monitor user, i want Firefox to always open and maximized on the second monitor. The problem is that by default Fixfox saves the location, size and window mode to the Localstore.rdf file in the profile directory on each window close. And so if you need to move one window to the first monitor and close it there. Firefox now always opens new window on the first monitor.
Since i dont found any configuration option to do this, ive searched on the Firefox extensibility points and found a solution.
In Firefox all is html (not really, this is called XUL) also the main window. So if you go to chrome://browser/content/browser.xul, you can inspect the dom of the Firefox main window with Firebug as you can do it with any web page.
If you look at the root element you can see an persit attribute with the values ‘screenX screenY width height sizemode’. As this looks very promising,ive tryed to set this attribute to ” and this did it!
I am not an Firefox extension developer, but ive collected enouth informations to create an simple extension which simply sets the persit attribute to ” while the window load event. Ive called it “Dont Store Main-Window Size and Location” and you can download it below.
Currently i made some tests on my private branch. The problem with this is that there is no way to get the model type and the view – layout combinition before the controller was executed.
So what i did to solve this. Ive added a new markup to NHaml with name MetaMarkupRule. This markup is implemented as property bag and this property’s are passed to the parser at compile time instead of runtime.
The idea is the following: In the view Ive put the a line like this (i currently don’t know if ~ is the best char for this):
Which results in a model property with value System.String which is passed to the Meta Dictionary inside of the TemplateParser.
The next step is to put a generic base type to the TemplateCompiler like this typeof(MyCustomView<>). Then direct after the parse step and right before the compiler melts the source and compiles it, we read the value of the model property if it is available (otherwise the default is System.Object) and create the model type with MakeGenericType of the base type. The result then looks like MyCustomView<System.String> which is this what you currently get if you call return View(“myview”,”mycustommodelstring”).
This could be the way to go for precompilation. After the precompilation return View(“myview”,”mycustommodelstring”) would not longer create the type, instead it searches in the list of the precompiled views and raises an exception if it dose not found the matching view type.
To solve the view-layout combinition problem we simply compile a version auf each view/layout combination that exists or we allow the view to specify also the layout. It is also an idea to allow a view specifiy more then one model. This could work as long as the both model types have the same propertys which are used in the view on it.