Post Reply 
Prox Menu: Show xx CSS
Apr. 18, 2009, 10:57 PM (This post was last modified: May. 08, 2009 02:32 PM by sidki3003.)
Post: #1
Prox Menu: Show xx CSS
5/08: attached files updated here

I'm using such a bookmarklet, similar to "Show xx Scripts", for Mozilla (by Jesse Ruderman) for a long while. However, the main drawback was that it didn't display imports.

Recently, ddandyy posted a "Show All CSSs" mod for the Prox menu. The new thing here is that it also displays most inline imports.

What follows is an attempt to get such a thing cross-browser ready, to also display (all!) imports by external style sheets, show disabled (i.e.: currently inactive) style sheets, etc.

The modified prox-x-menu.js is attached. (It also contains a fix for Google Chrome not reversing "Toggle Topo View".)

Below header filters need to be updated:
Code:
[HTTP headers]
In = FALSE
Out = TRUE
Key = "! : Redir: Delayed - /local.ptron/     9.04.17 [mona sd] (d.r) (Out) TEST"
URL = "($TST(hRdir=\0)|\0)&$TST(\0=[^/]+/local.ptron/((sidki_h*)\1$SET(2=http://local.ptron/\1)|$SET(keyword=.s_flag.)$SET(flag=.cookie_b:2.)\2))&$SET(hRdir=\2)"

In = FALSE
Out = TRUE
Key = "! : Redir: Delayed - Prox Query Strings II     9.04.16 [sd] (d.r) (Out)"
URL = "($TST(hRdir=\0)|\0)&$TST(\0=\1\?prx-(sniff:(proxov$TST(\1=((*.(aspx|css|json|js|vbs))\#prox)+\#)$SET(1=\@)$SET(2=Override)$SET(3=plain)$SET(flag=$TST(flag=(^*.cookie_)\6)\6cookie_b:1.)|$SET(2=Sniffer)\3)\&prx-$SET(hRealCT=\2: text/\3)|)ref:(\4(\?prx-*|#*)\5|\4))&$SET(hPrevRef=\4)$SET(hRdir=\1\5)"

In = FALSE
Out = TRUE
Key = "! : Redir: Final Redirect     9.04.17 [sd] (d.r) (Out) TEST"
URL = "$TST(hRdir=\1)&$TST(\1=https+://&\2)|$URL(\0://)$SET(2=\0://\1)&$RDIR(\2)$LOG(RGET $DTM(c) : Final Redirect: \2)$SET(hRdir=)"

! : Redir: . /local.ptron/ to Offsite Location becomes obsolete -> Uncheck.

After merging, disabling the respective previous filter versions, and saving, do "Configure -> OK -> Save -> Reload" three times.


The main obstacles being:
- Entirely different syntax in IE vs. W3C for accessing the import rules.
- At least 2 different security models for accessing off-domain rules.
- Turning imports with relative URLs into absolute ones.
- Getting IE to display text/css inline.


Tricky scenarios:
Lots of imports called by an onsite CSS, some disabled style sheets:
http://www.info07.com/

Like above, plus disabled imports, plus style sheets blocked by Proxomitron:
http://piro.sakura.ne.jp/

Off-domain import called by inline style (plus off-domain CSS bug):
http://googlesystem.blogspot.com/


If you get an empty popup or a download dialog, then something went wrong.
Let me know in this case (which doesn't imply that i can fix it).


Attached File(s)
.zip  proxjs-x-menu.zip (Size: 8.61 KB / Downloads: 721)
Add Thank You Quote this message in a reply
Apr. 19, 2009, 11:37 AM
Post: #2
RE: Prox Menu: Show xx CSS
The ddandyy version was firstly discussed here. I am glad to see you integrating this into your set.

sidki3003 Wrote:do "Configure -> OK -> Save -> Reload" three times.
Is there any special consideration to do that three times? For me a config save and reloading just goes well.
Add Thank You Quote this message in a reply
Apr. 19, 2009, 11:50 AM (This post was last modified: Apr. 19, 2009 11:51 AM by sidki3003.)
Post: #3
RE: Prox Menu: Show xx CSS
No. Except that three times always works.
Just Save -> Reload doesn't do alphanumeric header filter sorting in the config file.
Add Thank You Quote this message in a reply
Apr. 19, 2009, 12:35 PM
Post: #4
RE: Prox Menu: Show xx CSS
(Apr. 19, 2009 11:50 AM)sidki3003 Wrote:  Just Save -> Reload doesn't do alphanumeric header filter sorting in the config file.
Thanks for the tips. I had never noticed that before.
Add Thank You Quote this message in a reply
Apr. 19, 2009, 01:09 PM (This post was last modified: Apr. 19, 2009 03:20 PM by lnminente.)
Post: #5
RE: Prox Menu: Show xx CSS
I also do it 3 times always. Don't know if for me is past experiences or lazyness to investigate every phreaking thing of proxomitron Wink

BTW, Sidki many thanks for keep on sharing and doing it better Smile!
Add Thank You Quote this message in a reply
Apr. 19, 2009, 11:47 PM (This post was last modified: Apr. 19, 2009 11:52 PM by sidki3003.)
Post: #6
RE: Prox Menu: Show xx CSS
You're both welcome!
I thought i had added that alpha-sort issue to the FAQ, apparently not.

Oh, and....
(Apr. 19, 2009 11:37 AM)whenever Wrote:  The ddandyy version was firstly discussed here.

I have seen this post too, but found the essential things easier to spot in the Blog post.


And... IE6 was showing a "The page cannot be displayed" error when clicking the "Show xxx Scripts" link on pages that use recent versions of Prototype, this very page included.

That's because for IE the Prototype script is inserting a <script id=__onDOMContentLoaded src="//:" defer></script> tag, "//:" not being a valid URL. That is fixed (or, better, worked around) in posted menu script as well.
Add Thank You Quote this message in a reply
Apr. 20, 2009, 12:12 PM
Post: #7
RE: Prox Menu: Show xx CSS
I THINK we do it three times because it was something like...
1st- was saving disordered
2nd- was ordered from z to a
3rd- was ordered from a to z
Add Thank You Quote this message in a reply
Apr. 20, 2009, 01:01 PM
Post: #8
RE: Prox Menu: Show xx CSS
i just alphabetize myself and use a notepad-equiv for config updates...
saves the hassle of not know how Proxo is going to handle the header filter order...
Add Thank You Quote this message in a reply
Apr. 20, 2009, 01:20 PM
Post: #9
RE: Prox Menu: Show xx CSS
(Apr. 20, 2009 12:12 PM)lnminente Wrote:  I THINK we do it three times because it was something like...
1st- was saving disordered
2nd- was ordered from z to a
3rd- was ordered from a to z
It doesn't seem like that.

In my test, the imported header filters were firstly put in the beginning of the header filter section after the first save, and then sorted correctly after some reloading/saving. After that, further saving won't change the order any more.
Add Thank You Quote this message in a reply
Apr. 20, 2009, 06:27 PM
Post: #10
RE: Prox Menu: Show xx CSS
Thanks for testing Whenever, do you have any filter using the "URL:" format? Maybe the reason were them.
Add Thank You Quote this message in a reply
Apr. 21, 2009, 01:29 AM
Post: #11
RE: Prox Menu: Show xx CSS
No. Besides sidki's "!-|||||||||||| URL:" filters, I don't have mine. I prefer using IncludeExclude-U.ptxt to do the URL: things.
Add Thank You Quote this message in a reply
Apr. 24, 2009, 12:27 AM
Post: #12
RE: Prox Menu: Show xx CSS
Here comes the next step. I'll leave the original attachment in place, in case something goes awry. The required header filters didn't change.

- It displays 2nd level imports (imports imported by imports) too now.
- Pretty print (well, sort of) inline styles for Firefox and Opera. IE already does this.
- Numerous modifications in other menu functions, including a slightly nicer layout for IE and word wrapping, preserving the other <pre> attributes if possible.


I've noticed that my Opera (still at 9.63) is also affected by changes to JS document.domain, showing blank popups, like IE. So i've rewritten the method that calls menu generated popups, which seems to circumvent these problems for Opera, and after further changes for IE6, and, surprisingly, Chrome.

But not for my Vista VM IE7 No Expression . I don't have the debug tools there to digg into it, maybe someone else has, or even better, is familiar with IE8's debug tools. At any rate, i'm rather confident that this same-origin disaster can be solved for these browsers as well. But not by me.


I had to use setTimeouts to switch between Plan A and B. They are set rather low right now, 50ms and 200ms. I may have to increase them.

Affected menu items:
- Show xxx Scripts
- Show xxx CSS
- JS Variables (requiring the popups to be empty at first No Expression )
- Classes & IDs
- DOM Source (but now two style sheets have to be loaded into the body, eek!)


The attached zip also contains a new file, "info-pop.html". It goes to the same directory as "proxjs-x-menu.js".
If you look at the source of this new file, you'll see that this is all very much of a hack.

Tricky scenarios:
http://www.nordlys.no/
- 2nd level imports by off-domain import. Not shown in Firefox/Opera. Shown in IE/Chrome.

http://www.wunderground.com/global/stations/03772.html
- document.domain changed via JavaScript (previously blank popups in IE6 and Opera).
- Now forces "Plan B" in Firefox.

http://www.cbc.ca/technology/story/2009/...th021.html
- If you're one of the unlucky persons - like myself - who are partly locked out from their resources (missing styles), add this to your IncludeExclude-U list:
Code:
www.cbc.ca/includes/storypages/css/storypage.css\3
  &$SET(hRdir=www.cbc.ca.nyud.net/includes/storypages/css/storypage.css\3)
...or request that CSS with your remote proxy, which is probably faster.

- document.domain changed via JavaScript (previously blank popups in IE6 and Opera).
- 2nd level imports. To see these imports in Opera and Firefox, you'd need to be in debug mode. IE6 should work without that.
- "DOM Source" is black & white in IE6, but at least you see something now.

http://finance.yahoo.com/echarts?s=EURUS...X;range=5d
- document.domain not changed but explicitly set via JS (previously blank popups in IE6).


Attached File(s)
.zip  prox-menu_4-24.zip (Size: 9.98 KB / Downloads: 759)
Add Thank You Quote this message in a reply
Apr. 24, 2009, 09:27 AM
Post: #13
RE: Prox Menu: Show xx CSS
(Apr. 24, 2009 12:27 AM)sidki3003 Wrote:  So i've rewritten the method that calls menu generated popups, which seems to circumvent these problems for Opera, and after further changes for IE6, and, surprisingly, Chrome.
Great improvement! Worked under latest Opera 10 beta build too.

(Apr. 24, 2009 12:27 AM)sidki3003 Wrote:  But not for my Vista VM IE7 No Expression .
not for my IE8 too. No Expression
Add Thank You Quote this message in a reply
Apr. 25, 2009, 09:54 PM
Post: #14
RE: Prox Menu: Show xx CSS
Next step:
- Get away from setTimeouts and some other hackery.
- Fix defunct "Toggle Topo View" menu item in IE7.
- Fix "Toggle DOM Path" not being reversible in IE7.
("Allow status bar updates via script" has to be enabled for this to work).
Also, just display the nearest parent tags, to keep the entire status string visible.
- Fix blank popups in IE7 on pages with "document.domain" being set by JS! Big Teeth
(...by setting "document.domain" as well, in a pseudo same-domain document.)

Someone please try in IE8.


Attached File(s)
.zip  prox-menu_4-25.zip (Size: 9.94 KB / Downloads: 656)
Add Thank You Quote this message in a reply
Apr. 26, 2009, 12:02 AM
Post: #15
RE: Prox Menu: Show xx CSS
(Apr. 25, 2009 09:54 PM)sidki3003 Wrote:  Someone please try in IE8.

will do...
thanks for the update...
Add Thank You Quote this message in a reply
Post Reply 


Forum Jump: