maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   Changing MicroB browser width resolution. (https://talk.maemo.org/showthread.php?t=43159)

Shanezlar 2010-04-12 19:32

Re: Changing MicroB browser width resolution.
 
1 Attachment(s)
I just found a way to do something close to what you are asking, albeit just for the page you are currently viewing (not as a browser setting).

type the following in your address bar:
Code:

javascript:var d=(document.body.style.minWidth="1050px");
Replace 1050 with the width you want. Tested only on talk.maemo.org
You can also create a bookmark with the above code as URI (address) and use it as a shortcut.

Together with browser-plugins such as Greasemonkey you can probably have a general solution (i.e. apply this to all pages of a certain domain), but I haven't tried it yet.

jakiman 2010-04-12 20:49

Re: Changing MicroB browser width resolution.
 
wow. that actually works exactly how I want it. 1050 width renders TMO actually 100% perfectly it seems. also, it makes the browser much more useable in many sites. Noticed that the setting disappears soon as I go to a different link/site however. doh.

is there greasemonkey plugin for maemo5 MicroB?

Shanezlar 2010-04-12 20:57

Re: Changing MicroB browser width resolution.
 
Quote:

Originally Posted by jakiman (Post 607550)
Noticed that the setting disappears soon as I go to a different link/site however.

That is because it is not a setting but rather a change to the CSS (style/appearance) of the currently displayed page.
TMO could actually put that in their CSS-file and have it work for all users automatically (but there might be undesirable side effects - such as portrait mode being unusable - and some users might like this style less).

Quote:

is there greasemonkey plugin for maemo5 MicroB?
I've seen it in extras-testing (usual warnings apply)

jakiman 2010-04-12 21:58

Re: Changing MicroB browser width resolution.
 
Hmm. Tried installing greasemonkey from HAM but it doesn't show up in the add-ons in MicroB. Tried uninstall / reinstall a few times but still same. Hmm.

Shanezlar 2010-04-12 23:09

Re: Changing MicroB browser width resolution.
 
Quote:

Originally Posted by jakiman (Post 607638)
Hmm. Tried installing greasemonkey from HAM but it doesn't show up in the add-ons in MicroB. Tried uninstall / reinstall a few times but still same. Hmm.

Current greasemonkey in testing seems to be missing a link.
Running the following in xterm fixed it for me:
Quote:

Originally Posted by Shanezlar (Post 607679)
ln -s /usr/lib/browser/extensions/{e4a8a97b-f2ed-450b-b12d-ee082ba24781} ~/.mozilla/microb/extensions/{e4a8a97b-f2ed-450b-b12d-ee082ba24781}

(need to restart microB afterwards, e.g. by closing all of its windows)

I made a very basic greasemonkey script, that sets the minimum width on talk.maemo.org to 1050 pixels.
Don't have a webspace to host the script, so I'll just post the code here
Code:

// Increase body minimum width script for talk.maemo.org
//
// --------------------------------------------------------------------
//
// ==UserScript==
// @name          Body width extender
// @namespace    body_width_extender
// @description  extends the minimum body width on talk.maemo.org to 1050 pixels
// @include      http://talk.maemo.org/*
// ==/UserScript==


document.body.style.minWidth="1050px";

Save this into 'body_width_extender.user.js' somwhere on your N900 and open it with microB (e.g. 'file:///home/users/MyDocs/body_width_extender.user.js'). Confirm the dialog and the script will be installed. Now tmo should increase it's width to 1050 pixels after fully loading.

To add more sites to be affected by the script or to uninstall it access 'chrome://greasemonkey/content/manage.xul‎' in microB.

A more complex script that uses configurable widths for particular sites would not be too hard write either (writing a nice UI for this would take some time however).

Ronaldo 2010-04-13 02:09

Re: Changing MicroB browser width resolution.
 
i just installed it without any issues. thanks

Shanezlar 2010-04-13 19:40

Re: Changing MicroB browser width resolution.
 
My previous script made the site hard to read in portrait mode (one handed use), so I wrote a gm-script that is aware of the current orientation.

Furthermore you can now specify some variables in 'about:config' (read the warning there) under greasemonkey.scriptvals.body_width_extender. They are:
-"minWidth": desired minimum width in pixels for the pages where this script is active (default: 1050)
-"applyInLandscapeMode": whether it should be applied while in landscape mode (default: true)
-"applyInPortraitMode": same as above for portrait mode (default: false)

For those interested:
Code:

// Minimum body width extender
// greasemonkey script
// ----------------------------------------------------------------
//
// ==UserScript==
// @name          Body width extender
// @namespace    body_width_extender
// @description  extends the minimum body width on talk.maemo.org to 1050 pixels
// @include      http://talk.maemo.org/*
// ==/UserScript==


var originalMinWidth = document.body.style.minWidth;
var desiredMinWidth = GM_getValue("minWidth",-1);

if(desiredMinWidth == -1)
{
        GM_setValue("minWidth","1050");
        desiredMinWidth = 1050;

        GM_setValue("applyInLandscapeMode", true);
        GM_setValue("applyInPortraitMode", false);
}

checkMinWidthForCurrentWindow();
window.addEventListener('resize', checkMinWidthForCurrentWindow, false);

function checkMinWidthForCurrentWindow()
{
        if((isInLandscape() && GM_getValue("applyInLandscapeMode")) || (!isInLandscape() && GM_getValue("applyInPortraitMode")))
        {
                document.body.style.minWidth=desiredMinWidth+"px";
        }
        else
        {
                document.body.style.minWidth=originalMinWidth;
        }
}

function isInLandscape()
{
  if(screen.width==480) return false
  else return true;
}


maemo.it 2010-11-17 20:12

Re: Changing MicroB browser width resolution.
 
Hi guys, sorry for my ignorance. Why happens it?
Why microb browser literally cut part of some webpages?
I don't understand.
Thank you for explanation... :)

Changegames 2011-04-01 19:21

Re: Changing MicroB browser width resolution.
 
Quote:

Originally Posted by Shanezlar (Post 609200)
My previous script made the site hard to read in portrait mode (one handed use), so I wrote a gm-script that is aware of the current orientation.

Furthermore you can now specify some variables in 'about:config' (read the warning there) under greasemonkey.scriptvals.body_width_extender. They are:
-"minWidth": desired minimum width in pixels for the pages where this script is active (default: 1050)
-"applyInLandscapeMode": whether it should be applied while in landscape mode (default: true)
-"applyInPortraitMode": same as above for portrait mode (default: false)

For those interested:
Code:

// Minimum body width extender
// greasemonkey script
// ----------------------------------------------------------------
//
// ==UserScript==
// @name          Body width extender
// @namespace    body_width_extender
// @description  extends the minimum body width on talk.maemo.org to 1050 pixels
// @include      http://talk.maemo.org/*
// ==/UserScript==


var originalMinWidth = document.body.style.minWidth;
var desiredMinWidth = GM_getValue("minWidth",-1);

if(desiredMinWidth == -1)
{
        GM_setValue("minWidth","1050");
        desiredMinWidth = 1050;

        GM_setValue("applyInLandscapeMode", true);
        GM_setValue("applyInPortraitMode", false);
}

checkMinWidthForCurrentWindow();
window.addEventListener('resize', checkMinWidthForCurrentWindow, false);

function checkMinWidthForCurrentWindow()
{
        if((isInLandscape() && GM_getValue("applyInLandscapeMode")) || (!isInLandscape() && GM_getValue("applyInPortraitMode")))
        {
                document.body.style.minWidth=desiredMinWidth+"px";
        }
        else
        {
                document.body.style.minWidth=originalMinWidth;
        }
}

function isInLandscape()
{
  if(screen.width==480) return false
  else return true;
}


sorry for reviving this thread but i need help ive used this script but how can i exclude websites? the add button dont work on preferences and the only one i can edit on included website is http://talk.maemo.org/*

ive also tried editing the js file but still didnt work.


All times are GMT. The time now is 16:29.

vBulletin® Version 3.8.8