diff options
-rw-r--r-- | .SRCINFO | 18 | ||||
-rwxr-xr-x | .gitignore | 9 | ||||
-rw-r--r-- | PKGBUILD | 18 | ||||
-rw-r--r-- | aw-snap-reloader-background.js | 189 | ||||
-rw-r--r-- | aw-snap-reloader-manifest.json | 14 | ||||
-rw-r--r-- | chromium-fullscreen.xinitrc | 40 | ||||
-rw-r--r-- | disable-x-frame-option-background.js | 14 | ||||
-rw-r--r-- | disable-x-frame-option-manifest.json | 10 |
8 files changed, 21 insertions, 291 deletions
@@ -17,18 +17,12 @@ pkgbase = chromium-fullscreen depends = unclutter depends = chromium depends = xlogin-git - source = chromium-fullscreen.sysuser - source = chromium-fullscreen.xinitrc - source = disable-x-frame-option-background.js - source = disable-x-frame-option-manifest.json - source = aw-snap-reloader-background.js - source = aw-snap-reloader-manifest.json - md5sums = 9e979fbdd1e4a5a04fd0e91ce6a9a7be - md5sums = 857a60ed5fdf55a8c63e1d4dc854fcab - md5sums = c700c36f4ea3e353c6d49df823561fc4 - md5sums = f543ec018edbaf5533e6bddd5068ff54 - md5sums = a2e49410d550e79ac9c0037121522387 - md5sums = 729c8bb0e52fdd35c9c02fd6b1394d06 + source = https://raw.githubusercontent.com/julianxhokaxhiu/AUR/master/chromium-fullscreen/chromium-fullscreen.sysuser + source = https://raw.githubusercontent.com/julianxhokaxhiu/AUR/master/chromium-fullscreen/chromium-fullscreen.xinitrc + source = https://raw.githubusercontent.com/julianxhokaxhiu/AUR/master/chromium-fullscreen/disable-x-frame-option-background.js + source = https://raw.githubusercontent.com/julianxhokaxhiu/AUR/master/chromium-fullscreen/disable-x-frame-option-manifest.json + source = https://raw.githubusercontent.com/julianxhokaxhiu/AUR/master/chromium-fullscreen/aw-snap-reloader-background.js + source = https://raw.githubusercontent.com/julianxhokaxhiu/AUR/master/chromium-fullscreen/aw-snap-reloader-manifest.json pkgname = chromium-fullscreen diff --git a/.gitignore b/.gitignore new file mode 100755 index 000000000000..3984462d2c24 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +# Ignore everything +* + +# ...but +!.gitignore +!.SRCINFO +!PKGBUILD +!*.install +!*.sysuser @@ -8,18 +8,12 @@ arch=('x86_64' 'i686' 'arm' 'armv6h' 'armv7h') license=('MIT') depends=('xorg-server' 'xorg-xinit' 'xorg-xset' 'xorg-xrandr' 'unclutter' 'chromium' 'xlogin-git') install='chromium-fullscreen.install' -source=('chromium-fullscreen.sysuser' - 'chromium-fullscreen.xinitrc' - 'disable-x-frame-option-background.js' - 'disable-x-frame-option-manifest.json' - 'aw-snap-reloader-background.js' - 'aw-snap-reloader-manifest.json') -md5sums=('9e979fbdd1e4a5a04fd0e91ce6a9a7be' - '857a60ed5fdf55a8c63e1d4dc854fcab' - 'c700c36f4ea3e353c6d49df823561fc4' - 'f543ec018edbaf5533e6bddd5068ff54' - 'a2e49410d550e79ac9c0037121522387' - '729c8bb0e52fdd35c9c02fd6b1394d06') +source=('https://raw.githubusercontent.com/julianxhokaxhiu/AUR/master/chromium-fullscreen/chromium-fullscreen.sysuser' + 'https://raw.githubusercontent.com/julianxhokaxhiu/AUR/master/chromium-fullscreen/chromium-fullscreen.xinitrc' + 'https://raw.githubusercontent.com/julianxhokaxhiu/AUR/master/chromium-fullscreen/disable-x-frame-option-background.js' + 'https://raw.githubusercontent.com/julianxhokaxhiu/AUR/master/chromium-fullscreen/disable-x-frame-option-manifest.json' + 'https://raw.githubusercontent.com/julianxhokaxhiu/AUR/master/chromium-fullscreen/aw-snap-reloader-background.js' + 'https://raw.githubusercontent.com/julianxhokaxhiu/AUR/master/chromium-fullscreen/aw-snap-reloader-manifest.json') package() { # Copy autorun script diff --git a/aw-snap-reloader-background.js b/aw-snap-reloader-background.js deleted file mode 100644 index d7324e7c97bc..000000000000 --- a/aw-snap-reloader-background.js +++ /dev/null @@ -1,189 +0,0 @@ -// Inspiration for this extension: -// http://zerodeveloper.tumblr.com/post/67664299242/chrome-extension-reload-tab-after-crash -// and -// https://github.com/unclespode/ohnoyoudidnt - -// Different ways to test crashes and other problems in Chrome/Chromium: -// In Chrome/Chromium see chrome://about under "For debug", currenlty -// the following options are available: -// chrome://badcastcrash/ -// chrome://crash/ -// chrome://crashdump/ -// chrome://kill/ -// chrome://hang/ -// chrome://shorthang -// chrome://gpuclean/ -// chrome://gpucrash/ -// chrome://gpuhang/ -// chrome://memory-exhaust/ -// chrome://ppapiflashcrash/ -// chrome://ppapiflashhang/ -// chrome://quit/ -// chrome://restart/ -// -// Another option is to open the developer tools on a tab that should be -// crashed and in the JavaScript console type: -// -// var memoryHog = "more"; while(true) {memoryHog = memoryHog + "andMore";} -// -// This code will consume so much memory that the tab will crash - -// About reloading of tabs; see: https://developer.chrome.com/extensions/tabs -// chrome.tabs.reload(integer tabId, object reloadProperties, function callback) -// tabId (integer optional): The ID of the tab to reload; -// defaults to the selected tab of the current window. -// reloadProperties (object optional): bypassCache (boolean optional): Whether -// using any local cache. Default is false. -// callback (function optional): If you specify the callback parameter, -// it should be a function that looks like this: function() {...}; -// -// For the use case of reloading a kiosk app or tabs that the user is using -// the default of calling chrome.tabs.reload() is best - -var tabSuccessCount = {}; // store of succesful probe calls -var tabUnresponsiveCount = {}; // store of probe calls that got stuck in limbo -// Interval between checks, do not make this too short ( -// less than 1 second seems unwise, better no less than -// 2 seconds) since it is also used to determine if a -// tab is unresponsive -var checkInterval = 10000; // in milliseconds -var tabsChecked = {}; // store for arrays of tab-ids that were checked -var checkIndex = 0; // index of current array of checked tab-ids -var nrTabs = 0; // current number of tabs - -function reloadTabIfNeeded(tab) { - return function(result) { - if (tabCrashed()) { - console.log("Crashed tab: title=" + (tab.title || "") + " id=" + tab.id + - " index=" + tab.index.toString() + " windowId=" + tab.windowId.toString() + - " sessionId=" + (tab.sessionId || "").toString() + - " highlighted=" + tab.highlighted.toString() + " active=" + tab.active.toString()); - if (tabShouldBeReloaded(tab)) { - console.log("Reload tab:" + tab.id.toString()); - chrome.tabs.reload(tab.id); - } - } else { - registerSuccessfulNoOp(tab); - } - tabsChecked[checkIndex].push(tab.id); - }; -} - -function tabShouldBeReloaded(tab) { - // Reload if at least one sucessful no-op has occurred. - // This might be too causious but ensures the tab was working - // before it crashed - // this also ensures that we do not reload a tab that takes a long - // time to load (being unresponsive whilst doing so) - return tabSuccessCount[tab.id] > 0; -} - -function registerSuccessfulNoOp(tab) { - if ((tabSuccessCount[tab.id] || null) === null) { - tabSuccessCount[tab.id] = 0; - } - tabSuccessCount[tab.id] += 1; - tabUnresponsiveCount[tab.id] = 0; -} - -function registerUnresponsive(tab) { - if ((tabUnresponsiveCount[tab.id] || null) === null) { - tabUnresponsiveCount[tab.id] = 0; - } - tabUnresponsiveCount[tab.id] += 1; -} - -function tabCrashed() { - // The crux of finding a crashed tab: - // If an operation (even a no-op) is executed on a crashed tab an error - // is reported which is available as the chrome.runtime.lastError - // The error incorrectly reports the tab was closed instead of the fact that the - // tab does not respond. - return chrome.runtime.lastError && chrome.runtime.lastError.message === "The tab was closed."; -} - -function checkTab(thisTab) { - if (relevantTab(thisTab)) { - // Perform a no-op as a probe to find if the tab reponds - chrome.tabs.executeScript(thisTab.id, { - // To find crashed tabs probing with a no-op is enough - // code: "null;" - // To find unresponsive tabs probing with some operation - // that takes CPU-cycles is needed - code: "1 + 1;" - }, reloadTabIfNeeded(thisTab)); - } -} - -function relevantTab(tab){ - // Only check tabs that have finished loading - // and that use the http or https protocol. - // This ignores tabs like chrome://... - // return tab.url.substring(0, 4) == "http" && tab.status == "complete"; - // This makes testing this extension more difficult, to test use - // the line below - return tab.status == "complete"; -} - -function reloadUnresposiveTabs(index, nrTabs, tabs) { - if (nrTabs === tabs.length && nrTabs > tabsChecked[index].length) { - var nrTabsToFind = nrTabs - tabsChecked[index].length; - console.log("Found " + nrTabsToFind.toString() + " unresponsive tabs"); - for (var j = 0; j < nrTabs && nrTabsToFind > 0; j += 1) { - if (tabsChecked[index].indexOf(tabs[j].id) == -1) { - registerUnresponsive(tabs[j]); - if (tabShouldBeReloaded(tabs[j])) { - console.log("Reload unresponsive tab:" + tabs[j].id.toString()); - // Reloading an unresponsive tab does not work - // chrome.tabs.reload(tabs[j].id); - // Therefore a new tab is created with the url of the old tab - // and the unresponsive tab is removed. - // Setting the new tab as active is mainly aimed at kiosk-like applications - chrome.tabs.create({url: tabs[j].url, active: true}, function(tab){ - console.log("Created new tab: id=" + tab.id.toString() + " title=" + (tab.title || "") + " url=" + (tab.url || "")); - }); - chrome.tabs.remove(tabs[j].id, function(){ - console.log("Removed unresponsive tab:" + tabs[j].id.toString()); - }); - } - nrTabsToFind -= 1; - } - } - } -} - -function checkTabs(tabs) { - // check for unresponsive tabs by checking the results of - // the previous round of checkTab calls - // NOTE: it is assumed all tabs have been checked (all callbacks - // initiated in the previous checkTabs call have ended (apart - // form the ones that were done on unresponsive tabs)). The - // checkInterval has to be long enough to make this a "certainty" - if (nrTabs > 0) { - reloadUnresposiveTabs(checkIndex, nrTabs, tabs); - } - - // roll the checkIndex around after 10 iterations - checkIndex = checkIndex > 9 ? 0 : (checkIndex + 1); - nrTabs = tabs.length; - tabsChecked[checkIndex] = []; - for (var i = 0; i < tabs.length; i += 1) { - checkTab(tabs[i]); - } -} - -// Reset the count for tabs that are closed or that change -function tabChanged(tabId, changeInfo, tab) { - console.log("Resetting Stats for tab: id=" + tabId.toString() + " title=" + - (tab !== undefined ? tab.title : "")); - tabSuccessCount[tabId] = 0; - tabUnresponsiveCount[tabId] = 0; -} - -setInterval(function() { - chrome.tabs.query({}, checkTabs); -}, checkInterval); - -// If the tab reloads, reset stats -chrome.tabs.onUpdated.addListener(tabChanged); -chrome.tabs.onRemoved.addListener(tabChanged); diff --git a/aw-snap-reloader-manifest.json b/aw-snap-reloader-manifest.json deleted file mode 100644 index c62fab273653..000000000000 --- a/aw-snap-reloader-manifest.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "Snapper - 'Aw snap' tab reloader", - "short_name": "Snapper", - "description": "Reload crashed or unresponsive Chrome tabs (Aw, snap). Specifically intended for digital signage content running in kiosk mode.", - "manifest_version": 2, - "version": "0.9.7.0", - "background": { - "scripts": ["background.js"], - "persistent": true - }, - "permissions": [ - "tabs" - ] -} diff --git a/chromium-fullscreen.xinitrc b/chromium-fullscreen.xinitrc deleted file mode 100644 index f245084088ed..000000000000 --- a/chromium-fullscreen.xinitrc +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash - -# Get the current resolution -RESOLUTION=`xrandr | grep \* | awk '{print $1}' | tr x ,` - -# The URL variuabile where we will store the final address to open -URL='' - -# This is usually the case of a Raspberry Pi-like installation ( arm platforms ) -if [ -f "/boot/chromium-autostart-url.txt" ]; then - URL=`cat /boot/chromium-autostart-url.txt` -# This is probably the case of generic setups on x86 platforms -elif [ -f "/home/chromium/chromium-autostart-url.txt" ]; then - URL=`cat /home/chromium/chromium-autostart-url.txt` -fi - -# Disable all energy save features, and leave the monitor always on -xset s off # don't activate screensaver -xset -dpms # disable DPMS (Energy Star) features. -xset s noblank # don't blank the video device - -# Hide mouse cursor -unclutter -display :0.0 -noevents -grab -root -reset & - -# Clear cache and config before starting the process -rm -Rf .cache .config - -# Autostart Chromium in Fullscreen mode -exec /usr/bin/chromium --disable \ - --no-first-run \ - --disable-translate \ - --disable-infobars \ - --disable-suggestions-service \ - --disable-save-password-bubble \ - --disable-session-crashed-bubble \ - --ignore-gpu-blacklist \ - --load-extension=.extensions/disable-x-frame-option,.extensions/aw-snap-reloader \ - --window-position="0,0" \ - --window-size="$RESOLUTION" \ - --kiosk "$URL" diff --git a/disable-x-frame-option-background.js b/disable-x-frame-option-background.js deleted file mode 100644 index 7731f4ec4f7c..000000000000 --- a/disable-x-frame-option-background.js +++ /dev/null @@ -1,14 +0,0 @@ -chrome.webRequest.onHeadersReceived.addListener( - function (details) { - for (var i = 0; i < details.responseHeaders.length; ++i) { - if (details.responseHeaders[i].name.toLowerCase() == 'x-frame-options') { - details.responseHeaders.splice(i, 1); - return { - responseHeaders: details.responseHeaders - }; - } - } - }, { - urls: ["<all_urls>"] - }, ["blocking", "responseHeaders"] -);
\ No newline at end of file diff --git a/disable-x-frame-option-manifest.json b/disable-x-frame-option-manifest.json deleted file mode 100644 index 8ec9201350a4..000000000000 --- a/disable-x-frame-option-manifest.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "Ignore X-Frame headers", - "description": "Drops X-Frame-Options HTTP response headers, allowing all pages to be iframed.", - "version": "1.0", - "manifest_version": 2, - "background": { - "scripts": [ "background.js" ] - }, - "permissions": [ "webRequest", "webRequestBlocking", "\u003Call_urls>" ] -} |