{"action":"opened","issue":{"url":"https://api.github.com/repos/luakit/luakit/issues/723","repository_url":"https://api.github.com/repos/luakit/luakit","labels_url":"https://api.github.com/repos/luakit/luakit/issues/723/labels{/name}","comments_url":"https://api.github.com/repos/luakit/luakit/issues/723/comments","events_url":"https://api.github.com/repos/luakit/luakit/issues/723/events","html_url":"https://github.com/luakit/luakit/issues/723","id":362976958,"node_id":"MDU6SXNzdWUzNjI5NzY5NTg=","number":723,"title":"Execute JS in context of page (window scope, able to modify DOM)","user":{"login":"PeterNerlich","id":10530729,"node_id":"MDQ6VXNlcjEwNTMwNzI5","avatar_url":"https://avatars2.githubusercontent.com/u/10530729?v=4","gravatar_id":"","url":"https://api.github.com/users/PeterNerlich","html_url":"https://github.com/PeterNerlich","followers_url":"https://api.github.com/users/PeterNerlich/followers","following_url":"https://api.github.com/users/PeterNerlich/following{/other_user}","gists_url":"https://api.github.com/users/PeterNerlich/gists{/gist_id}","starred_url":"https://api.github.com/users/PeterNerlich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PeterNerlich/subscriptions","organizations_url":"https://api.github.com/users/PeterNerlich/orgs","repos_url":"https://api.github.com/users/PeterNerlich/repos","events_url":"https://api.github.com/users/PeterNerlich/events{/privacy}","received_events_url":"https://api.github.com/users/PeterNerlich/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-23T21:00:20Z","updated_at":"2018-09-23T21:00:20Z","closed_at":null,"author_association":"NONE","body":"I'd like to make a shortcut that executes a certain bit of JavaScript in the current page, kind of as an alternative to some chrome extensions like Keepa *(for displaying an price history overlay when hovering over an Amazon product)* but that `w.view:eval_js()` doesn't execute in the same JS context. No console log messages and no DOM manipulation, apparently.\r\n\r\nCan someone tell me whether that is a limitation of luakit or if there in fact is another way? If something like that isn't implemented yet, where should I start looking into it and try whether I can write up a solution? Thank you very much in advance!\r\n\r\n--------\r\n\r\nI'm currently using this to test this:\r\n\r\n    modes.add_binds(\"normal\", {\r\n      { \"<Control-t>\", \"test\", function (w)\r\n        print('[test called lua]')\r\n        w.view:eval_js(\"console.log('[test called js]');document.body.classList.add('test');\", { no_return = true })\r\n      end},\r\n    })\r\n"}}
{"actor":{"display_login":"PeterNerlich"}}