Shopify add new index.html page with url https://myshopifyshop/index.html - shopify

I am working with external tracking service. They sent my index.html file, which looks like this:
<html>
<head>
<!-- tag -->
<script type="text/javascript" src="//path.js"></script>
</head>
<body>
</body>
</html>
They want us to upload this file to shopify and sent them the url to it. The url should look like this https://myshopifyshop/index.html. I couldn't find any article how to upload or create new blank html page with .html extension. Is this somehow possible?

You can't create an html page that will follow the root url of your site.
But you can upload a html page as an asset and link that asset as a page.
Example url will be:
https://cdn.shopify.com/s/files/1/*****/*****/t/4/assets/index.html
But I don't think that this will do you any good, since tracking services requires you to track the current site and not a dummy file that no one will ever open.
It's highly possible that the only important part is the script and everything else is not needed.
So you actually may need to add the script in your layout/theme.liquid file and ignore the rest.
Please contact the the tracking service and let them know that you are not using a static HTML site, but a Shopify one and what steps should you follow.

Related

ASP.NET page is not loading CSS styles on my local iis web server

I have a local ASP.NET web site written in VB.NET runing on W7.
The default web page contains a simple style sheet which is loaded as follows
<link rel="stylesheet" href="dchs.css" type="text/css" media="screen" runat="server"></link>
The page is displayed without the above styling. The style sheet does exist as I can display it via the web browers as
file:///c:/inetpub/wwwroot/c1/dchs.css
but I cannot display it via the brower using
http://localhost/c1/dchs.css
This leads me to believe that IIS has some form of access problem to the C1 directory. It a similar way I can display a jpeg image via file://c1 bit not via localhost which gives an error message
The image "http://localhost/c1/menu.jpeg" cannot be displayed, because it contains errors.
How you attached the .css file to your html project? where is it located?
Options:
1. Drag and drop your .css file to your html page.(Inside)
like this:
<link rel="Shortcut Icon" href="images/fil.ico" />
Make sure all folders and files are include when project deployed And a correct calling of id or class in your css of course.

Resolving js and css urls affected by app.Map in ASP.NET 5

I am implementing multi-tenancy based on the first folder segment of the request url.
As such I'm configuring each tenant separately by branching with IApplicationBuilder like this:
PathString path = new PathString("/somefolder");
app.Map(path,
branchApp =>
{
// code goes here to configure the branch
}
as a result of this if my view has a link with url /Home/About for example, it automatically is adjusted to be relative to the folder I branched on when I visit /somefolder, ie the links change to /somefolder/Home/About, somefolder/Home/Contact etc
This was kind of unexpected to me but actually helpful.
But also if my view has
<link rel="stylesheet" href="~/css/site.css" />
<script src="~/js/lib/jquery/dist/jquery.js"></script>
those now resolve to /somefolder/css/site.css and /somefolder/js/lib/jquery/dist/jquery.js
which is not what I want.
Is there some way I can change this behavior for js and css but keep it for navigation links?
No, you can't. At least, not easily: when using app.Map, it automatically sets HttpContext.Request.PathBase with the path parameter you specified, which causes the exact behavior you're seeing (it's basically a "virtual directory" equivalent).
The best option is to stop using virtual path links (~/) and replace them by standard root-relative links (/), that are not processed by Razor and MVC.
<link rel="stylesheet" href="/css/site.css" />
<script src="/js/lib/jquery/dist/jquery.js"></script>

Getting Rally API key to work outside of rally App

I have seen this question and response, but it still does not work for us:
Embedding Apps with API key
We are having a problem with the Rally API. Our intent is to make a stand-alone page (outside of Rally) that shows the portfolio Kanban.
I have attached the test page. It was created with the rally-app-builder. We created an API key. When we try to load the page, passing the API key, we get a json exception about cross-site violations. The documentation says that we will see this error if we don't pass the key. But even when we do pass it, the error persists.
We have tried it through an apache server, so the issue about being a standalone file is not our problem. Does anyone have any other ideas?
The html page is below.
<!DOCTYPE html>
<html>
<head>
<title>helloworld</title>
<script type="text/javascript" src="https://rally1.rallydev.com/apps/2.0rc3/sdk.js"></script>
<script type="text/javascript">
Rally.onReady(function () {
Ext.define("CustomApp",{extend:"Rally.app.App",componentCls:"app",items:{html:'App SDK 2.0rc3 Docs'},launch:function(){this.add({xtype:"rallycardboard",types:["Portfolio Item/Feature"],attribute:"State",storeConfig:{context:{project:"/project/14292239482",projectScopeUp:!1,projectScopeDown:!0}},context:this.getContext(),readOnly:!0})}});
Rally.launchApp('CustomApp', {
name:"helloworld",
parentRepos:""
});
});
</script>
<style type="text/css">
</style>
</head>
<body>
</body>
</html>
The api key we generated is of type alm-wsapi-read-only. When page is loaded, even with apikey parameter provided, we get the JSON x-site error.
We are wondering if there is a config to change on Rally subscription side or perhaps there is an error in the documentation or something else simple.
I submitted a defect. It works up to the point when I load an App-debug.html using rally-app-builder run command:
rab run
and append apiKey to the app's URL as a query parameter. It loads fine using the apiKey:
The problem starts when I choose a different server to load an embedded app, for example:
a)start a simple http python or node server in another directory
b)copy App-external.html from deploy folder to the directory from which the server is running
c)create a new file, App-embedded.html in this directory :
<html>
<header>
<title>Embedded app test: revs</title>
</header>
<body>
<iframe src="http://localhost:9000/App-external.html?apiKey=_Ib4u6d7"></iframe>
</body>
</html>
d)load App-embedded.html
These steps results in cross-origin error.
If you check in Chrome's Network tab, or Safari debugger it shows that artifact (hierarchicalrequirement or defect) requests fails. Interestingly, the preceding subscription, user and schema requests complete successfully. Screenshot from Safari:
It turns out that the underlying issues were related to the CORS configuration on the Rally servers, not anything specific with App SDK 2.0rc3. As of 11/24/14 this issue should be resolved.

SharePoint 2010 - Page Viewer

I would like to use the Page Viewer web part to display an html page with some java script. That page is to be hosted as a stand-alone page within SharePoint (perhaps under Shared Documents folder).
The problem is this: when I point the Web Part to use the page, it prompts me to save the html file rather than displaying its content inside the web part.
I am following general rules to create the html file:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>My Little SharePopint Page</title>
</head>
<body>
<div id="PlayerName">
</div>
<div id="display">
</div>
</body>
</html>
So I just need the page to be displayed inside the Page Viewer web part - and not to be prompted to save it as a file.
You web application configuration is forcing your users to download the file, this is by design and by default, you can change it in "Web Application General Settings" in central administration. look for "Browser File Handling" make sure its not strict. Check technet
page about this setting.
This can have security implications (Like loading PDF files inside the browser windows). There are other ways to accomplish this using js.
You need to remove everything north and south of the body tags first, they are already present through SharePoint. Then load the file (with just the div content) to your doc library and use the page viewer to point to that file.
I note that you are using PlayerName, impling that there is some type of flash/video player content to come later, depending on the object settings used that will also cause a "download" file display too.

How can I get site's favicon using Selenium

I need to get web site's favicon.
How can I do that?
You won't be able to get the favicon with Selenium you would have to use another program to grab it. The only way you would be able to get it is if your website rendered the favicon.ico as a link such as
<link rel="shortcut icon"
href="http://example.com/myicon.ico" />
However typically websites just store the favicon.ico in the root directory and on page request the browser retrieves it and drops it in the address bar or tab or wherever favicons are used. If this is how your favicon is rendered then there will be no code or anything to search for with Selenium.
Also the above code while it does work has some buggy support for IE7.
You don't need Selenium.
Just request the site's home page and use an HTML parser to find a <link rel="shortcut icon" href="..."> tag.
If you don't find any such tag, try /favicon.ico.
Here is a bit crazy but working solution:
get the favicon image opened in a web page (and hence reachable with selenium) with the help of "http://www.google.com/s2/favicons". There are other services which provide a similar functionality, see:
Get website's favicon with JS
use cssneedle package to compare the resulting favicon with a pre-saved one
Needle is a tool for testing your CSS with Selenium and nose.
It checks that CSS renders correctly by taking screenshots of portions
of a website and comparing them against known good screenshots. It
also provides tools for testing calculated CSS values and the position
of HTML elements.
In other words, we are going to compare favicon images.
Example implementation (python):
from needle.cases import NeedleTestCase
class FavIconTestCase(NeedleTestCase):
def test_so(self):
self.driver.get('http://www.google.com/s2/favicons?domain=www.stackoverflow.com')
self.assertScreenshot('img', 'so-favicon')