How to change where a url points locally - linux

So I'm on ubuntu and I'm using station, a sort of web app. It grabs some of its icons from a server. However, this server is no longer maintained. Therefore some icons do not display properly and some of the UI is not very usable. So I wanted to know if there could be a way to set locally that when the URLs of that icons are "searched", my computer searches instead a file stored locally on my computer (I was able to grab the URLs so that's dealt with). My next idea would be to try to edit the source code but I'm not should I would be able to achieve that.
Thanks

Related

Opening a link to download a pdf only works with hard reload and dev tools open

There are a several factors here (Heroku, Node, expressjs, react) as I'm working with a few technologies newer to me, so I'm not sure what the missing piece is.
I have a react/node app that is working for me in my local dev environment (using create-react-app).
My "/" route returns a list of documents, from which I create a list of links. When you click on one, it calls a route that returns a PDF.
This works great locally.
I've deployed it to Heroku and get the following behavior:
Click on link
Instead of opening the PDF, it opens a new tab with the correct URL, but the response is the list of documents instead of the selected PDF.
If I do a hard-reload, I get the same thing.
If I open dev tools in Chrome, I get the same thing.
If I open dev tools AND THEN do a hard-reload, I get the attachment to render!!
If I then do a reload again, it reverts back to showing me the list.
In Edge, I don't need to have dev tools open. Just a hard-reload will render the attachment, but clicking refresh after, brings the list back instead.
Things I've considered:
+ If it were a caching issue, I would expect subsequent reloads to render the PDF, despite whether the Control key were down or dev tools open. Both requests are returning 200, although the one that is not working as expected is returning 200 (from ServiceWorker). The Remote Addresses are also different.
+If it were a routing issue, I wouldn't expect the PDF to ever get rendered properly.
Things I've noticed in hunting this down:
+ The requests are differing
Any guidance is greatly appreciated!
Okay, I've figured it out. The rubber duck helped me :-)
If I don't use https, all is working fine. I'm not sure, however, why dev tools + hard reload allows me to make the request properly.

Load locally stored images through css with inspect element

I'm trying to redesign a small portion of vastly huge site and I was told that I can load custom images to Inspect Element (Chrome) if they are located in the same path as the stylesheet to which the site is remapped. (all done through css via 'content: url('...');') but the webpage is still looking for them in its own resources. So is there a way to use a locally stored image with Inspect Element?
When you're passing images in locally you can use, for example:
file:///C:/Users/[username]/Desktop/picture.png
So if I was to change a background image I would use
background-image:url("file:///C:/Users/Julia/Desktop/background.png");
But note that a lot of sites don't allow you to load local resources, so an error may appear in the inspect console when you try.
Actually, it only works with background instead of background-image (not sure if it works) but background without image seems to work. So put in:
file:///Users/[YourName]/Documents/picture.png
Like this:
background:url("file:///Users/[YourName]/Documents/picture.png")
I just decided to contribute because I just wanted to try it out myself as well and found this as the first answer despite the post being 2-3 yrs old; although for other users it might be helpful.
Also, this was done on Opera, but haven't tried it on other browsers, but it does work for me. Don't include the drive name. But you can simply copy the URL, by dragging the image into the browser (if it loads it) and copy the link. It should work (usually older browsers that don't auto-download the image).

WordPress can't display uploaded images (3.6)

I'm having a bit of trouble with a client site, on their server (our development server is fine).
We were hoping to push it live today, so we created a test subdomain to make sure his server's okay with the site.
However, the media uploader doesn't seem to work properly. The file will upload, without any error messages, however, instead of displaying the image in the thumbnail preview, it shows a little blue ?.
The file is actually uploaded to the server, but for some reason it can't be displayed online.
For example this should be the location of a newly upload image, but for some reason it can't be accessed.
I was thinking the issue is with folder permissions, but changing everything to 777 didn't seem to do anything. So I'm a little confused as to what's wrong.
Apparently they host a couple dozen WordPress sites and don't have this issue. I did think it's a server problem because it works on two other servers.
Anyone had an issue like this before?
[EDIT]
It turns out deactivating a plugin called Sell Media Watermark does the trick.
However, this plugin is needed so I'm working to find a fix for it :)

Making a EXISTING CMS site compatible for mobile site NOT REDIRECT

Making a EXISTING CMS site compatible for mobile site NOT REDIRECT
Hi All.
I am currently creating a mobile version of an expression engine site that we use.
I am having problems with this, because typically I can just use media quires, or use redirect scripts.
However, the layout of the mobile site will be completely different from the desktop, so I can't just fiddle with a media quires for the CSS (as site just looks to different).
I was thinking of using a javascript to wipe the code or markup (php) if the device is mobile BUT it would mean perhaps loading two versions of code anytime a page loads up (not good for mobile). Eg one code for desktop and another for mobile.
I can't change the file names eg (mobile_index) because it is a CMS and the links wont link up correctly. I have tried this a few times , and also editing the .HTACCESS file, but it simply didnt work.
So if anyone knows how do I change the code of a page if the device mobile, but cant change file name, directory or any of that :-)
Cheers
Daragh
Why no redirect? If I was in your position, which I was a few months ago, I would handle this totally different:
Install Multiple Site Manager by ExpressionEngine: http://expressionengine.com/user_guide/cp/sites/index.html
Add another site -- mobile
Give it a proper domainname like m.domain.com
Give it its own template group
... and redirect with http://github.com/sebarmeli/JS-Redirection-Mobile-Site/
Now you can manage both installations from the same CMS and both installations can access existing channels, modules, extensions and members. This will keep your code fast and clean.
Adding a bunch of conditionals will only slow down installation.
Actually you could mess with media queries - it's the most flexible. JS is really overkill for something like this. At larger sizes, UL>LI menus could appear, and at smaller sizes they could be hidden (display:none) and swapped to select lists; divs can be replaced, elements dropped or resized. I also combine them with different snippets or embeds so you can tailor the content out as well.
You might try something like MX Mobile Device Detect. It gives you some variables that can detect if the user is on a mobile device that you could use in conditionals in your templates.

Ideas for launching an installed app from a webpage

I am thinking about having the following use-case:
User installs application on local machine.
User goes to our website, and are presented with many links (choices).
User clicks on a link.
Application starts, with some information contained within the link passed to the application.
Step 4 is obviously a security minefield. The end goal is that the user makes a choice, and if the application is installed, it starts with some information passed to it (ie command line parameters, or perhaps a temp file somewhere on the user's machine)
Can I/ Should I access the registry from javascript? Are there any ideas about how I might go about this? Do you have an alternative suggestion?
Assuming the applications the user installs are also developed by you.
Register a file extension for use by the specific application - then your web links can be links to a file that is downloaded and auto-run by your app. The file could contain details on the defaults for your app to use.
Sort of like how clicking on a .pdf file opens your pdf reader.
As an alternative to the file-extension solution you may want to know about Custom Application Protocol feature. Link is for Windows but there are nearly same techniques on other systems. I can't say if this approach works in every browser but you may want to try it out.
Accessing the registry from JavaScript inside a browser is nigh on impossible for the security implications. To access the registry from the web, I'd imagine you'd have to use a binary (C++ or others) program that can read the registry, but also has an HTTP module to communicate with your server.
Sounds like you might need the Click Once deployement feature for your app. I think once it's installed over http there should be a pretty easy way to launch an executable.
http://en.wikipedia.org/wiki/ClickOnce

Resources