[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Is it possible to override browser (firefox in this case) behavior

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 14
Thread images: 1

Is it possible to override browser (firefox in this case) behavior on opening any links?
What I want to achieve is:
>click on link
>decide if this link would open in new window/tab
>---if yes, make system handle this link (open in default web browser), or at least (if previous option is impossible for some reason) ignore attempt to open this link and do nothing
>---if no, just open the link as usual

>inb4 why would you want soemthing like this
I am using more than one browser profile at once. Let's say that one is meant to browse only banking websites and related stuff. I want the browser to not let open any link that leads to other website than the one I'm currently browsing, or in a perfect situation - to open this link in my default profile to browse other stuff.
(I can still just drag and drop any link to my default profile, that's why disabling links is an option too)

I thought about some greasemonkey script that would work on every page and override event that starts when clicking a hyperlink.

Is there anything like that? (I dind't forund anything, but it's kinda hard to describe this problem in a few words to put them into any serach engine)
Can somebody write gm script for me? (or at least tell me that it's possible to do, I know some /basics/ of js, I'll probably manage do write it on my own, but I need to know if there's a point in trying and where to start.

I know that /g/ is NOT my personal tech support, but I don't think that's the case. If you have on mind any better place where I should post this thread - let me know.
>>
OP here, sorry for a few typos and shit english, but OneeChan makes it almost impossible to verify what I wrote in this tiny-as-fuck QR window.
If anything is unclear, I'll try my best to explain it.
>>
What is this dumb shit supposed to accomplish?
>>
yes. Add an event listener for document, check if e.target is an HTMLAnchorElement with a src , and if not, do the same check for the parentNode until you reach document, in that case, do nothing.
If you found a link this way, call e.preventDefault and instead show your dialog.

You can do that.
As far as I know there is no way to open a link in a different web browser. You might be able to use a custom protocol (think something like torrent: mailto: or myownshittyhandler: ) and register a program for that in your OS.
>>
>>56495572
There is a way, I believe that you can make system open the link with default web browser for you. There's probably some js call to execute command as system "run" tool does.
I mean in windows, but probably you can do same thing with unix shell.
>>
>>56496188
Holy god no. You wouldn't want that, ever.
If random websites were able to do this, you would be fucked and the disgusting fatbeards who are paranoid about "MUH NUNFREE JABBASHRERPT" actually had ground to stand on.

On internet explorer you can actually do this with an ActiveX object. But that's why you're smart enough not to use that garbage, right?
>>
>>56496378
Common Sense TM says that you're right, but I'm almost certaint that I've seen js code capable of doing so somewhere...
>>
>>56496411
Pretty sure it isn't. But Windows and the unices as well I guess should have a way to register custom programs for custom protocols / URI schemes. After all, when opening a magnet: link, your os will open your torrent client if there is any.

There's probably some mapping in the registry that maps URI schemes to programs to launch.
So as long as you have the computer you're doing this on under your control, you should be able to do this.
>>
>>56492978
you know noscript exists, right?
>>
O'kay.
So, how do I start?
> Add an event listener for document, check if e.target is an HTMLAnchorElement with a src , and if not, do the same check for the parentNode until you reach document, in that case, do nothing.
>If you found a link this way, call e.preventDefault and instead show your dialog.

Anyone is willing to waste 5 minutes of their life and send me a GM script template, or should I /thread and kindly ask uncle Bootnet to help me out?

>>56496606
yes, what would it change?
I want my browser to stop opening urls that I click if they're leading to another page.
>>
I'm not sure if I understand you correctly.
You want one browser for normal websites, and one browser (with specific - I assume security related - behavior) for specific websites to download your child porn and order your drugs.
And you make the decision which link opens in which browser based on individual, manual choice, right?

So why not just install 2 browsers and bind a key (middle mouse button for example) or a menu entry to "open in that other browser"?

Or am I misunderstanding you and there's some sort of automation or link-recognizing?
>>
>>56496757
That's right, but....
...it opens the selected browser wth a link
Not the link in selected browser. So for second one I'l get the warning that this browser is already running.
Also, I want this to prevent me missclicking some random shit on websites. As I said, I can just drag-drop links to another browser profile, that's what I'm doing now. But some mechanism that would prevent them from opening if I accidentially click on them would be nice.
>>
>>56496860
Whitelist?
>>
>>56496877
Yeah, used it for a while, but every time I was trying to open some page that wasn't whitelisted I was literally getting cancer from visiting about:addons, goind to settings and manually creatnig new rule. There's no good whitelist addons for firefox I know about.
Thread posts: 14
Thread images: 1


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.