Does the IBooks reader allow setting and reading cookies?
Basically what I need is that the status of one page (the user clicking on some elements) gets stored and used in the next page.
I have been experimenting and so far I could not get it to work, thus I wonder whether cookies are supported at all.
I found my own answer. I was able to store cookies inside an epub3 eBook using the js-cookie library. Unfortunately the cookie is only visible for the current page and is not useful to share information between pages (which in epub3 are different html5 documents).
Related
This is my first time posting on Stack Overflow and I have a question about the GDPR.
Hi there! (This is ment to be on top of the post, but for some reason it gets deleted when I save it)
Situation:
On my website I don't want to bother visitors with cookie notifications, so the goal is to only place necessary cookies. However, there will be embedded YouTube video's on the website, which usually places tracking cookies.
After some research I stumpled upon the youtube-nocookie.com domain, which I am using now. Without using that domain, an embedded video url will be:
https://www.youtube.com/embed/7cjVj1ZyzyE
With using it, it is:
https://www.youtube-nocookie.com/embed/7cjVj1ZyzyE
By using the latter, cookies will only be placed after playing the video, and no tracking cookies will be placed (according to Google: https://support.google.com/youtube/answer/171780?hl=en under 'Turn on privacy-enhanced mode'). However, there will still be placed some cookies, and it is not clear for me if visitors will need to give permission for those, and if so, under what category (and maybe they are still tracking?).
Image of the cookies:
Image of cookies youtube-nocookies.com places
This is in Chrome. The cookies from the gstatic domain are placed on page-load for some reason. That doesn't happen in Opera.
Another weird thing is that FireFox (with allowing all cookies and trackers) and Edge don't seem to place any of the 6 cookies from the image at all.
Many sites and blogs say that this is the way to embed YouTube video's, but I can't seem to find a clear answer to the question if you still need visitors' permission for these cookies. Also on many sites where I only accept necessary cookies, I still have the possibility to view YouTube video's and the corresponding cookies will be happily placed without my consent.
Has anybody delt with this before?
Thanks in advance!
After some more research I think I found a clear answer. From a report of Cookiebot:
“Privacy-Enhanced Mode” currently
stores an identifier named “yt-remote-device-id”
in the web browser’s “Local Storage”. This
allows tracking to continue regardless of
whether users click, watch, or in any other way
interact with a video – contrary to Google’s
claims. Rather than disabling tracking, “privacyenhanced mode” seems to cover it up.
Source: https://www.cookiebot.com/media/1136/cookiebot-report-2019-ad-tech-surveillance-2.pdf
The 'yt-remote-device-id' indentifier, along with some other ones, are, even with the use of the youtube-nocookie.com domain (or 'Privacy Enhanced Mode'), still being placed on page load (given that the iframe with the set source is already part of the DOM at this point of course).
So while no tracking 'cookies' cookies are placed, the tracking has moved to the browsers localStorage (I overlooked this before), which basically means visitors actually do need to give permission before embedded YouTube video's with Privacy Enhanced Mode enabled should be loaded on the page.
Update
Gave some nuance in response to Marc Hjorth's comment.
i can confirm that the localStorage entry effectively replaces the funktion of the cookie. it is persistent and makes you identifiable across browser sessions. i get the same "yt-remote-device-id" value each time after restarts. only erasing the local storage makes a difference.
I know how to get the localStorage from any open wep page by using content scripts. So I'm basically able to open a new tab with my own web page and read the storage data with a content script and message it to the background page.
But now I'd like to do this without loading an external page every time. Is there a way to access the localStorage of a page directly from within the extension? Maybe some query to chrome directly.
I don't see any API for that.
Your options are:
Make a native messaging host application that would read database files directly from Local Storage directory in the browser user profile. An example: What's the best way to read Sqlite3 directly in Browser using Javascript?
Put the other page into an iframe: Is it possible to use HTML5 local storage to share data between pages from different sites?
P.S. "Ironic side note" quoted from Cross-domain localStorage article by Nicholas C. Zakas.
Who knew cross-domain client-side data storage would be useful? Actually, the WHAT-WG did. In the first draft of the Web Storage specification (at that time, part of HTML5), there was an object called globalStorage that allowed you to specify which domains could access certain data. [...]
The globalStorage interface was implemented in Firefox 2 prematurely as the specification was still evolving. Due to security concerns, globalStorage was removed from the spec and replaced with the origin-specific localStorage.
I'm looking to include a small window that shows the last 5 pages they visited on a my site.
Primarily I'd like it to show the title of the page and the URL so I can link them to it. It would be great if I can filter these to a word or website since I'd like to be for my site only.
Would JavaScript be good for this and does it work cross browsers?
You can only look 1 page back which is document.referrer but I am not sure how to get the title.
If you are monitoring your own site you can use localStorage to store the last 5 pages but if you want to monitor other sites then no you cant do it in Javascript that will be a privacy concern if you can do it.
localStorage is HTML5 but its already supported by major browsers.
If you are doing server-side scripting it should be fairly simple to keep a record of what page they have visited on your website. It could be done with Javascript and cookies, but it does not necessarily have to be done that way.
How to make static fixed HTML element on every page of site?
I mean - for example, it is music player on site. It's displaying in corner of page, and while navigating on site - it doesn't reload.
Also, If you open many pages of site (different tabs) than state of this element is the same on all pages. (If I change something in this element on one page - it's changed on every page).
For real example I can provide a link (I think, it's allowed to do this on this site):
http://www.jamendo.com/en/album/40689
If you click "Play" - music player is opened. If you open other artist in other window - two players will be the same. If you have changed volume in one window - volume is changed in other too.
What techniques are used here? Can you give some references to read about such technologies?
Hopefully the site is working the same as it was when you posted the link...
This site is using Flash which seems to be using LocalConnection and ExternalInterface. The Flash object in the popup is the one actually playing the music. The controls on the page are calling a Flash object on the page which just sends commands to the popup.
Well I can give you a general idea of how I would do it.
You would need to persist the data of the feature you wan't to be the same across all pages.
For example: if you wanted something to be in the same position across all pages, you could store the current position of that variable in a session variable, cookie, or database for that particular user/ip address. Then you would make GET requests to the server "asking" for the most recent position of whatever you're tracking. And if it's different update the position accordingly.
You would need to make use of Javascript, A programming language, and some kind of data persistence.
If you want to read about the newest stuff, you could easily do this with node.JS. There is a library out there that makes it very easy to reflect server side changes on the client w/o making GET requests (making it a good for chat applications).
You can use local storage to store the current settings and poll them from each open instance. You won't need to use AJAX or the server if you only care about the settings being synchronized across one machine.
How can I check if a certain link is found in Chrome's browsing history(on the computer that accesses the link) using JavaScript or jQuery? I am interested (if any) in the functions that I have to use. Also how can I get the date and time of the accessed link?
Retrieving the users history from javascript launched from a web page is impossible due to obvious blatant security issues.
Retrieving the users history from javascript running in an extension is possible, but doing so requires elevated permissions that the user has to grant after being warned. In summary you are probably looking for the chrome.history.getVisits() function. You can find more information on how to access the history using chrome.history here and the resulting security warnings given to the user here.
Nonono! That cannot happen. Unless you make a plugin, but I still doubt it.
This might be off topic but you might be interested in google analytics.
this chrome extension allow you to use browser address bar to search keywords, which will automatically search against your browser history and give you suggestion
Chrome webstore - history as bookmark
This is just not possible with Chrome because of security. What you would have to do is use cookies and add to the cookie each page the user is on along with the time visited.
Problem with this it will only track a user on your site not others. Cookies are only suppose to hold small amounts of info not long tracks of what page your user has been on. Also a user can disable cookies...
Another way is maybe doing this serverside and tracking the users IP through your pages and keep a list of what pages your user is visiting.