You are not logged in.

#826 2012-03-31 22:17:54

Asmir
Member
From: BiH
Registered: 2011-10-06
Posts: 67

Re: luakit browser framework (almost with jQuery!)

I've tried it, and somehow I get the same behavior like before.  :\

Offline

#827 2012-03-31 23:43:25

bootleg
Member
Registered: 2010-12-08
Posts: 38

Re: luakit browser framework (almost with jQuery!)

Here is my attempt: Replace the new_tab function in window.lua by this one:

new_tab = function (w, arg, switch, order)
        local view
        if w.tabs:count() == 0 then
            view = webview.new(w)
            w.tabs:insert(taborder.default(w,view), view)
            if type(arg) == "string" then view.uri = arg
            elseif type(arg) == "table" then view.history = arg end
            return view
        else
            window.new({arg})
            return nil
        end
    end,

It seems to work, this may not be the best solution though wink

Last edited by bootleg (2012-03-31 23:45:39)

Offline

#828 2012-04-01 07:45:53

Asmir
Member
From: BiH
Registered: 2011-10-06
Posts: 67

Re: luakit browser framework (almost with jQuery!)

Yes, it's a little unclean but it'll do it for now. Thanks guys. big_smile

Last edited by Asmir (2012-04-01 07:46:15)

Offline

#829 2012-04-01 19:57:42

Ragnis
Member
Registered: 2012-01-29
Posts: 14

Re: luakit browser framework (almost with jQuery!)

After I view the source by typing :viewsource, how can I get back to the webpage?

Offline

#830 2012-04-01 21:07:08

bootleg
Member
Registered: 2010-12-08
Posts: 38

Re: luakit browser framework (almost with jQuery!)

with :viewsource!

Offline

#831 2012-04-02 01:31:18

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: luakit browser framework (almost with jQuery!)

Following up on my previous question (hoping someone can help): when I run luakit in verbose mode this is the error I get when I click the javascript link

luakit wrote:

** Message: console message: <snip long url> @1: ReferenceError: Can't find variable: __doPostBack

The <snip> was my editting.  The url is for a academic journal database which my university has a subscription to.  I have this problem with all such journal articles.  I'd be happy with any sort of work around, I just don't know enough about javascript to know what this __doPostBack function is, so I don't know where to start in getting more info.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Online

#832 2012-04-02 04:59:09

mason.larobina
Member
From: Australia
Registered: 2009-07-02
Posts: 200
Website

Re: luakit browser framework (almost with jQuery!)

Trilby wrote:

Following up on my previous question (hoping someone can help): when I run luakit in verbose mode this is the error I get when I click the javascript link

luakit wrote:

** Message: console message: <snip long url> @1: ReferenceError: Can't find variable: __doPostBack

The <snip> was my editting.  The url is for a academic journal database which my university has a subscription to.  I have this problem with all such journal articles.  I'd be happy with any sort of work around, I just don't know enough about javascript to know what this __doPostBack function is, so I don't know where to start in getting more info.

I think I know the cause and have a solution to your problem.

We evaluate `javascript:..` links on the main webkit webview frame however it may be that your link resides in another sub-frame on that page which will have a totally different javascript environment and other global variables and functions.

I've just pushed a fix to the latest develop head, would you mind giving it a try?

(direct link https://github.com/mason-larobina/luaki … 4db08d7328)

Offline

#833 2012-04-02 05:25:50

BKLive
Member
From: Georgia
Registered: 2008-01-28
Posts: 125

Re: luakit browser framework (almost with jQuery!)

I am unable to follow links that are videos (youtube, google video, etc.). I don't have a mouse at all, and I feel like these elements should have some kind of identifier that would allow the 'f'ollow function to operate them? feature request I guess?

Also, when I updated libwebkit to 1.8 it broke my ability to follow text fields to input junks. I reported it on the GitHub tracker, but I was wondering if anyone else had this issue?

Love this browser, btw.


Main Arch Setup: HP Pavillion p7-1209, Quad-Core i3-2120 3.3Ghz, 8GB RAM, 1TB HDD, Intel Graphics
Laptop Arch Setup: Gateway lt3103u Netbook, AMD Athlon64 1.2Ghz, 2GB RAM, 250GB HDD, ATI X1270 R600

Offline

#834 2012-04-02 09:40:33

bratmaxe
Member
From: Germany
Registered: 2010-11-07
Posts: 71

Re: luakit browser framework (almost with jQuery!)

anti-destin wrote:
anti-destin wrote:

strange. i tried changing that line to match what you have, but that had no effect.

i copied over the stock config files and tried redoing everything. now the custom css file works, but only for some pages. for example, gmail uses large fonts, but the arch linux forum does not. but this is most likely not a luakit issue now.

I recently found a much better solution when looking at the webkit settings. To change default fonts and size you can use something like this:

        monospace_font_family       = "Liberation Mono",
        sans_serif_font_family      = "Liberation Sans",
        serif_font_family           = "Liberation Serif",
        minimum_font_size           = "16"

There is a link in the globals.lua where all those settings are explained smile

Offline

#835 2012-04-02 11:17:11

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: luakit browser framework (almost with jQuery!)

RE: Javascript

Thanks. I suspect you are right about the problem.  But the proposed solution did not seem to change anything.  If it helps the site that I'm testing it on is ebscohost.  I'd provide a link, but I haven't been able to find a publicly accessible url that would have the "show article" link that is not responding.  Most universities will have subscriptions to ebsco, so I suspect others could (attempt to) replicate the problem.

For more context on the error, this is the verbose output on the last attempt with the change in window.lua; this output looks identical to the output without the change, but I've added a few lines before the "error" that are emitted while the mouse is over the link that fails.

D: luakit: luaH_object_emit_signal:261: emitting "expose" on 0xb20c1870 with 0 args and 0 nret
D: luakit: luaH_object_emit_signal:261: emitting "button-press" on 0xb20c1870 with 3 args and 1 nret
D: luakit: luaH_object_emit_signal:261: emitting "expose" on 0xb20c1870 with 0 args and 0 nret
D: luakit: luaH_object_emit_signal:261: emitting "button-release" on 0xb20c1870 with 3 args and 1 nret
D: luakit: luaH_object_emit_signal:261: emitting "root-active" on 0xb20c1870 with 0 args and -1 nret
D: lousy.signal: emit_signal: "mode-changed" on table: 0xb209f530
D: lousy.signal: emit_signal: "mode-entered" on table: 0xb209f530
** Message: console message: http://web.ebscohost.com.silk.library.umass.edu/ehost/detail?sid=294ef8dc-3b4d-411e-bad2-073387239b09%40sessionmgr11&vid=1&hid=112&bdata=JnNpdGU9ZWhvc3QtbGl2ZSZzY29wZT1zaXRl#db=pdh&AN=xan-10-4-426 @1: ReferenceError: Can't find variable: __doPostBack

"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Online

#836 2012-04-03 20:12:58

anti-destin
Member
Registered: 2009-02-14
Posts: 234

Re: luakit browser framework (almost with jQuery!)

bratmaxe wrote:
anti-destin wrote:
anti-destin wrote:

strange. i tried changing that line to match what you have, but that had no effect.

i copied over the stock config files and tried redoing everything. now the custom css file works, but only for some pages. for example, gmail uses large fonts, but the arch linux forum does not. but this is most likely not a luakit issue now.

I recently found a much better solution when looking at the webkit settings. To change default fonts and size you can use something like this:

        monospace_font_family       = "Liberation Mono",
        sans_serif_font_family      = "Liberation Sans",
        serif_font_family           = "Liberation Serif",
        minimum_font_size           = "16"

There is a link in the globals.lua where all those settings are explained smile

wow, thanks, bratmaxe. that's exactly what i was after.

Offline

#837 2012-04-04 09:51:22

seydanator
Member
Registered: 2012-04-04
Posts: 3

Re: luakit browser framework (almost with jQuery!)

Hello @all,

I am a long-term arch forums reader and have not need to ask something, it's always already answered smile

Recently, I stumbled about this great browser and so far all is working fine.
But I use a lot of tabs, and sometimes they are all gone, if I forgot to :write and shutdown ...

Is there a way to save the opened tabs on loading pages?

Greetings

Offline

#838 2012-04-04 11:11:41

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: luakit browser framework (almost with jQuery!)

Seydanator, if I understand correctly that is the default behavior when you quit with ZZ while ZQ quits without saving.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Online

#839 2012-04-04 11:30:37

seydanator
Member
Registered: 2012-04-04
Posts: 3

Re: luakit browser framework (almost with jQuery!)

Trilby wrote:

Seydanator, if I understand correctly that is the default behavior when you quit with ZZ while ZQ quits without saving.

Yeah, but I fear losing my tabs if for example the OS crashes, or I fall over my power cable, or the workers digging in front of my home hit the power cable (again...).
So I would like to have always an up-to-date session file, if this is possible.

Greetings

Offline

#840 2012-04-04 11:50:59

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: luakit browser framework (almost with jQuery!)

Ah, now I see.  Yes, it is certainly possible.  There may be a better method, but if I wanted this behavior I'd edit window.lua (should be in ~/.config/luakit, or you should copy it to there from the xdg folder).

On line 658 you'll find a function called "navigate".  I'd add a line just before the closing "end" which is on line 671.  The line should save the current session by calling w:save_session().

    navigate = function (w, uri, view)
        view = view or w.view
        if view then
            local js = string.match(uri, "^javascript:(.+)$")
            if js then
                --return view:eval_js(luakit.uri_decode(js), "(javascript-uri)")
                return view:eval_js(luakit.uri_decode(js),
                    "(luakit::navigate)", true)
            end
            view.uri = uri
        else
            return w:new_tab(uri)
        end
        w:save_session()  -- THIS LINE WAS ADDED
    end,

Again, there may be a better way, but this should work as a starting point.

Note: I have not tested this. I just tested this, it seems to work.  Post back if it does not do what you want.

Last edited by Trilby (2012-04-04 11:55:50)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Online

#841 2012-04-04 12:51:28

seydanator
Member
Registered: 2012-04-04
Posts: 3

Re: luakit browser framework (almost with jQuery!)

Unfortunately this is not working for me, no session file is created. I'm using the luakit from community, if this is important.

First I thought about using a signal, like in changing the blank page

webview.init_funcs.set_dark_about_blank = function (view, w)
    view:add_signal("navigation-request", function (_, uri)
        if uri == "about:blank" then
            view:load_string("<html><body bgcolor='#000000'></body></html>", "about:blank")
            return true
        end
    end)
end

but either I used the wrong signal or the wrong function call.

-EDIT-
got it! added call in new_tab method in window.lua:

new_tab = function (w, arg, switch, order)
        ...
        -- Update statusbar widgets
        w:update_tab_count()
        w:update_tablist()
        w:save_session() -- EDITED
        return view
    end,

Thx Trilby

Last edited by seydanator (2012-04-04 16:10:23)

Offline

#842 2012-04-05 18:25:30

kcirick
Member
Registered: 2010-06-21
Posts: 364

Re: luakit browser framework (almost with jQuery!)

Hi,

Maybe this question has been raised already, but is there an extension on luakit to disable flash unless the user wants it (sort of like Chrome/Chromium's Flashblock extension)? I don't want to copletely disable the flash, because it is nice to have in general. This is the only thing that's preventing me from using luakit on regular basis. I don't want the flash ads to play and distract me on some webpages.

Thanks in advance!

Offline

#843 2012-04-05 23:02:42

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: luakit browser framework (almost with jQuery!)

seydanator wrote:

Thx Trilby

Cool.  Glad I could at least inspire, if not solve.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Online

#844 2012-04-05 23:07:10

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: luakit browser framework (almost with jQuery!)

Kcirick, I'm sure there is such an option.  Off hand I don't know where it is (I may look in the *.lua's later), but as a quick note you might be interested in trying dwb as well.  What you want is the default behavior in dwb.  I have switched from dwb to luakit and feel it fits me just a bit better, but the two are very similar (from the user-experience perspective) - if you like one, you'll almost certainly like the other.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Online

#845 2012-04-06 05:39:43

phynix
Member
Registered: 2008-09-21
Posts: 28

Re: luakit browser framework (almost with jQuery!)

I am getting a strange behavior were Facebook will load the top bar and nothing else. The only content besides the bar is a blank white page.

Offline

#846 2012-04-06 08:09:35

anti-destin
Member
Registered: 2009-02-14
Posts: 234

Re: luakit browser framework (almost with jQuery!)

phynix wrote:

I am getting a strange behavior were Facebook will load the top bar and nothing else. The only content besides the bar is a blank white page.

i had this problem as well. i fixed it by changing the user agent string. in globals.lua, i have:

globals.useragent = string.format("Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.142")

Offline

#847 2012-04-06 17:32:16

Draven94
Member
Registered: 2012-03-21
Posts: 11

Re: luakit browser framework (almost with jQuery!)

phynix wrote:

I am getting a strange behavior were Facebook will load the top bar and nothing else. The only content besides the bar is a blank white page.

Me too, but in my case the problem is javascript... sad

Offline

#848 2012-04-08 05:24:53

phynix
Member
Registered: 2008-09-21
Posts: 28

Re: luakit browser framework (almost with jQuery!)

Sadly I have already tried changing the string. Thanks for the suggestion.

Offline

#849 2012-04-08 12:16:45

Draven94
Member
Registered: 2012-03-21
Posts: 11

Re: luakit browser framework (almost with jQuery!)

At this time Facebook doesn't work for me, I have tried various solutions but nothing...I hope in your help smile

Offline

#850 2012-04-08 13:23:05

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: luakit browser framework (almost with jQuery!)

Are you using luakit from [community] or a more recent version?

With the [community] version I don't have any problem viewing facebook pages - though clicking on a result in the search bar is another story.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Online

Board footer

Powered by FluxBB